[FFmpeg-devel,1/5] avformat/mpsubdec: Clear queue on error

Submitted by Michael Niedermayer on Sept. 21, 2019, 4:57 p.m.

Details

Message ID 20190921165728.24496-1-michael@niedermayer.cc
State Accepted
Commit 9a0d36e562d53716cf000895c2f892fb1f48165d
Headers show

Commit Message

Michael Niedermayer Sept. 21, 2019, 4:57 p.m.
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@niedermayer.cc>
---
 libavformat/mpsubdec.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Niedermayer Oct. 8, 2019, 12:52 p.m.
On Sat, Sep 21, 2019 at 06:57:24PM +0200, Michael Niedermayer wrote:
> 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@niedermayer.cc>
> ---
>  libavformat/mpsubdec.c | 3 +++
>  1 file changed, 3 insertions(+)

will apply patchset

[...]

Patch hide | download patch | download mbox

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;
 }