avformat/4xm: Consider max_streams on reallocating tracks array
Fixes: OOM
Fixes: 41595/clusterfuzz-testcase-minimized-ffmpeg_dem_FOURXM_fuzzer-6355979363549184
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 0dcd95ef8a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
6cdc8b3c13
commit
0bcd3550a4
1 changed files with 2 additions and 1 deletions
|
|
@ -136,7 +136,8 @@ static int parse_strk(AVFormatContext *s,
|
|||
return AVERROR_INVALIDDATA;
|
||||
|
||||
track = AV_RL32(buf + 8);
|
||||
if ((unsigned)track >= UINT_MAX / sizeof(AudioTrack) - 1) {
|
||||
if ((unsigned)track >= UINT_MAX / sizeof(AudioTrack) - 1 ||
|
||||
track >= s->max_streams) {
|
||||
av_log(s, AV_LOG_ERROR, "current_track too large\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue