diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-08-04 12:21:51 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-15 12:25:45 +0100 |
commit | b7fcf8bf26a3421d6f753f5e762022fc11cb52e5 (patch) | |
tree | fbbede46fb824a5034f1635ee998260db7fb8b68 | |
parent | e7efe2aacfd5fdde4b3e7ec7bd9af1a577c6f0e1 (diff) | |
download | ffmpeg-b7fcf8bf26a3421d6f753f5e762022fc11cb52e5.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); |