Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
libopusenc
Commits
0130afaa
Unverified
Commit
0130afaa
authored
Apr 07, 2018
by
Mark Harris
Committed by
Jean-Marc Valin
Apr 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix uninitialized var and memory leak on error
Signed-off-by:
Jean-Marc Valin
<
jmvalin@jmvalin.ca
>
parent
40e3c703
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/opusenc.c
src/opusenc.c
+4
-1
No files found.
src/opusenc.c
View file @
0130afaa
...
...
@@ -636,8 +636,10 @@ static void encode_buffer(OggOpusEnc *enc) {
oggp_commit_packet
(
enc
->
oggp
,
nbBytes
,
granulepos
,
e_o_s
);
if
(
e_o_s
)
ret
=
oe_flush_page
(
enc
);
else
if
(
!
enc
->
pull_api
)
ret
=
output_pages
(
enc
);
else
ret
=
0
;
if
(
ret
)
{
enc
->
unrecoverable
=
OPE_WRITE_FAIL
;
if
(
packet_copy
)
free
(
packet_copy
);
return
;
}
if
(
e_o_s
)
{
...
...
@@ -647,6 +649,7 @@ static void encode_buffer(OggOpusEnc *enc) {
ret
=
enc
->
callbacks
.
close
(
enc
->
streams
->
user_data
);
if
(
ret
)
{
enc
->
unrecoverable
=
OPE_CLOSE_FAIL
;
free
(
packet_copy
);
return
;
}
}
...
...
@@ -654,7 +657,7 @@ static void encode_buffer(OggOpusEnc *enc) {
enc
->
streams
=
tmp
;
if
(
!
tmp
)
enc
->
last_stream
=
NULL
;
if
(
enc
->
last_stream
==
NULL
)
{
if
(
packet_copy
)
free
(
packet_copy
);
free
(
packet_copy
);
return
;
}
/* We're done with this stream, start the next one. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment