diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-03-06 18:14:12 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-04-13 00:35:15 +0200 |
commit | fef832c188c07245c7b9a44432a89f49a4c0d2ff (patch) | |
tree | a8c7d99151571d14ff3aaca0080760196aabc7b3 | |
parent | 6daa205cd3fe32dcf6eb61c8949fab33a3501498 (diff) | |
download | ffmpeg-fef832c188c07245c7b9a44432a89f49a4c0d2ff.tar.gz |
avformat/oggdec: Fix metadata memleak on multiple headers
Fixes: Chromium bug 800123
Reported-by: Matt Wolenetz <wolenetz@google.com>
Reviewed-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit da069e9c68ec1a54e618940dcb9ebae9bf179a32)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/oggdec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index 193a286e43..6a05278b52 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -128,7 +128,10 @@ static int ogg_restore(AVFormatContext *s) ogg->state = ost->next; for (i = 0; i < ogg->nstreams; i++) { - av_freep(&ogg->streams[i].buf); + struct ogg_stream *stream = &ogg->streams[i]; + av_freep(&stream->buf); + av_freep(&stream->new_metadata); + if (i >= ost->nstreams || !ost->streams[i].private) { free_stream(s, i); } |