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 652ea23cb3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
3f57ece8e6
commit
8108273941
1 changed files with 4 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue