summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2019-08-04 12:21:51 +0200
committerMichael Niedermayer <[email protected]>2019-11-11 20:18:46 +0100
commitc3b4278b013ca22f9adfa643972ecd4804ad19c7 (patch)
tree0f20df3fbba178d4cd64e5e1eb8b8d10ed3e2d48
parent1bfaa22889f63714f2c2eeb6d7a3b4cb34471a53 (diff)
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 <[email protected]> (cherry picked from commit 652ea23cb34bc59b38c0088865600e2b86079815) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/realtextdec.c4
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);