diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-08-04 12:21:51 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-07-01 12:11:55 +0200 |
commit | ae6bd1fd3efa251607b01ee8d7a248c9f34e661b (patch) | |
tree | e1af29650933b5ff09f46c6e1310c5e9588eb841 | |
parent | db696af196bf7d1c352b08918b6f8019c14692ab (diff) | |
download | ffmpeg-ae6bd1fd3efa251607b01ee8d7a248c9f34e661b.tar.gz |
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@niedermayer.cc>
(cherry picked from commit 652ea23cb34bc59b38c0088865600e2b86079815)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/realtextdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/realtextdec.c b/libavformat/realtextdec.c index 618d4f78ec..b33d5289f7 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); |