[FFmpeg-cvslog] avformat/mpsubdec: Clear queue on error

Michael Niedermayer git at videolan.org
Tue Oct 8 17:28:22 EEST 2019


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Sep 21 13:43:19 2019 +0200| [9a0d36e562d53716cf000895c2f892fb1f48165d] | committer: Michael Niedermayer

avformat/mpsubdec: Clear queue on error

Fixes: Memleaks
Fixes: 17219/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5720539124989952

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9a0d36e562d53716cf000895c2f892fb1f48165d
---

 libavformat/mpsubdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/mpsubdec.c b/libavformat/mpsubdec.c
index 3d8dcb35c2..82c73457ea 100644
--- a/libavformat/mpsubdec.c
+++ b/libavformat/mpsubdec.c
@@ -163,6 +163,9 @@ static int mpsub_read_header(AVFormatContext *s)
     ff_subtitles_queue_finalize(s, &mpsub->q);
 
 end:
+    if (res < 0)
+        ff_subtitles_queue_clean(&mpsub->q);
+
     av_bprint_finalize(&buf, NULL);
     return res;
 }



More information about the ffmpeg-cvslog mailing list