[FFmpeg-cvslog] avformat/realtextdec: Check for duplicate extradata in realtext_read_header()

Michael Niedermayer git at videolan.org
Mon Aug 5 20:50:28 EEST 2019


ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Sun Aug  4 12:21:51 2019 +0200| [f9597a5a111bc79f15ad2c02d57c56dbfad8542e] | committer: Michael Niedermayer

avformat/realtextdec: Check for duplicate extradata in realtext_read_header()

Fixes: memleak
Fixes: 16140/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5684008052064256

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 652ea23cb34bc59b38c0088865600e2b86079815)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/realtextdec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/realtextdec.c b/libavformat/realtextdec.c
index e12871e6ad..204e557aa2 100644
--- a/libavformat/realtextdec.c
+++ b/libavformat/realtextdec.c
@@ -87,6 +87,10 @@ static int realtext_read_header(AVFormatContext *s)
             /* save header to extradata */
             const char *p = ff_smil_get_attr_ptr(buf.str, "duration");
 
+            if (st->codecpar->extradata) {
+                res = AVERROR_INVALIDDATA;
+                goto end;
+            }
             if (p)
                 duration = read_ts(p);
             st->codecpar->extradata = av_strdup(buf.str);



More information about the ffmpeg-cvslog mailing list