Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
d894f747
Commit
d894f747
authored
Jan 04, 2013
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oggdec: make sure the private parse data is cleaned up
parent
89b51b57
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
oggdec.c
libavformat/oggdec.c
+4
-0
oggdec.h
libavformat/oggdec.h
+1
-0
oggparsevorbis.c
libavformat/oggparsevorbis.c
+11
-0
No files found.
libavformat/oggdec.c
View file @
d894f747
...
...
@@ -533,6 +533,10 @@ static int ogg_read_close(AVFormatContext *s)
for
(
i
=
0
;
i
<
ogg
->
nstreams
;
i
++
)
{
av_free
(
ogg
->
streams
[
i
].
buf
);
if
(
ogg
->
streams
[
i
].
codec
&&
ogg
->
streams
[
i
].
codec
->
cleanup
)
{
ogg
->
streams
[
i
].
codec
->
cleanup
(
s
,
i
);
}
av_free
(
ogg
->
streams
[
i
].
private
);
}
av_free
(
ogg
->
streams
);
...
...
libavformat/oggdec.h
View file @
d894f747
...
...
@@ -55,6 +55,7 @@ struct ogg_codec {
* Number of expected headers
*/
int
nb_header
;
void
(
*
cleanup
)(
AVFormatContext
*
s
,
int
idx
);
};
struct
ogg_stream
{
...
...
libavformat/oggparsevorbis.c
View file @
d894f747
...
...
@@ -192,6 +192,16 @@ fixup_vorbis_headers(AVFormatContext * as, struct oggvorbis_private *priv,
return
offset
;
}
static
int
vorbis_cleanup
(
AVFormatContext
*
s
,
int
idx
)
{
struct
ogg
*
ogg
=
s
->
priv_data
;
struct
ogg_stream
*
os
=
ogg
->
streams
+
idx
;
struct
oggvorbis_private
*
priv
=
os
->
private
;
int
i
;
if
(
os
->
private
)
for
(
i
=
0
;
i
<
3
;
i
++
)
av_freep
(
&
priv
->
packet
[
i
]);
}
static
int
vorbis_header
(
AVFormatContext
*
s
,
int
idx
)
...
...
@@ -359,5 +369,6 @@ const struct ogg_codec ff_vorbis_codec = {
.
magicsize
=
7
,
.
header
=
vorbis_header
,
.
packet
=
vorbis_packet
,
.
cleanup
=
vorbis_cleanup
,
.
nb_header
=
3
,
};
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