diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-08-04 12:21:51 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-01-06 11:30:42 +0100 |
commit | 8108273941efbc2916af0cd3fe9ff1d9ec69977e (patch) | |
tree | 08579658d669a7e4c389743eba2349b1b2cccdeb | |
parent | 3f57ece8e6071eef1c71b90164b59ac1b12d8bae (diff) | |
download | ffmpeg-8108273941efbc2916af0cd3fe9ff1d9ec69977e.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); |