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
Opusfile
Commits
6452e838
Commit
6452e838
authored
Jul 31, 2020
by
Felicia Lim
Committed by
Timothy B. Terriberry
Jul 31, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix memory leak caused by incorrect link count to clean up on error.
parent
a55c164e
Pipeline
#2087
passed with stage
in 59 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
src/opusfile.c
src/opusfile.c
+3
-2
No files found.
src/opusfile.c
View file @
6452e838
...
...
@@ -1267,6 +1267,8 @@ static int op_bisect_forward_serialno(OggOpusFile *_of,
ret
=
op_fetch_headers
(
_of
,
&
links
[
nlinks
].
head
,
&
links
[
nlinks
].
tags
,
_serialnos
,
_nserialnos
,
_cserialnos
,
last
!=
next
?
NULL
:&
og
);
if
(
OP_UNLIKELY
(
ret
<
0
))
return
ret
;
/*Mark the current link count so it can be cleaned up on error.*/
_of
->
nlinks
=
nlinks
+
1
;
links
[
nlinks
].
offset
=
next
;
links
[
nlinks
].
data_offset
=
_of
->
offset
;
links
[
nlinks
].
serialno
=
_of
->
os
.
serialno
;
...
...
@@ -1277,8 +1279,7 @@ static int op_bisect_forward_serialno(OggOpusFile *_of,
if
(
OP_UNLIKELY
(
ret
<
0
))
return
ret
;
links
[
nlinks
].
pcm_file_offset
=
total_duration
;
_searched
=
_of
->
offset
;
/*Mark the current link count so it can be cleaned up on error.*/
_of
->
nlinks
=++
nlinks
;
++
nlinks
;
}
/*Last page is in the starting serialno list, so we've reached the last link.
Now find the last granule position for it (if we didn't the first time we
...
...
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