[FFmpeg-cvslog] avformat/oggdec: fix leak in ogg_restore()
Michael Niedermayer
git at videolan.org
Thu Mar 2 04:13:54 EET 2017
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Tue Feb 28 15:16:54 2017 +0100| [e46ab997506e8aa84344c29553ebacca7993904c] | committer: Michael Niedermayer
avformat/oggdec: fix leak in ogg_restore()
Fixes: asan_bug_leak
Found-by: Thomas Guilbert <tguilbert at google.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e46ab997506e8aa84344c29553ebacca7993904c
---
libavformat/oggdec.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 98cd0f5..edeae2b 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -127,8 +127,12 @@ static int ogg_restore(AVFormatContext *s)
ogg->state = ost->next;
- for (i = 0; i < ogg->nstreams; i++)
+ for (i = 0; i < ogg->nstreams; i++) {
av_freep(&ogg->streams[i].buf);
+ if (i >= ost->nstreams || !ost->streams[i].private) {
+ free_stream(s, i);
+ }
+ }
avio_seek(bc, ost->pos, SEEK_SET);
ogg->page_pos = -1;
More information about the ffmpeg-cvslog
mailing list