mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/vividas: Check buffer size before allocation
Fixes: out of array access Fixes: 15365/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5716153105645568 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
8e41675e18
commit
c3ef24d9ba
|
@ -251,6 +251,9 @@ static uint8_t *read_sb_block(AVIOContext *src, unsigned *size,
|
||||||
*key = tmpkey;
|
*key = tmpkey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (n < 8)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
buf = av_malloc(n);
|
buf = av_malloc(n);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue