]> git.sesse.net Git - ffmpeg/commitdiff
avformat/realtextdec: free queue on error
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 21 Aug 2019 18:37:17 +0000 (20:37 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 22 Aug 2019 16:35:44 +0000 (18:35 +0200)
Fixes: memleak
Fixes: 16277/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5696629440512000
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/realtextdec.c

index 204e557aa294816c1f029ff0b7ff7d6ed1d0b7cd..c2316da0ed8d1878df8d85fae698cc8d7502edef 100644 (file)
@@ -123,6 +123,8 @@ static int realtext_read_header(AVFormatContext *s)
 
 end:
     av_bprint_finalize(&buf, NULL);
+    if (res < 0)
+        ff_subtitles_queue_clean(&rt->q);
     return res;
 }