Commit 1cbac9ce authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/vb: Check for end of bytestream before reading blocktype

Fixes: Timeout
Fixes: 9601/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VB_fuzzer-4550228702134272

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent acba153a
......@@ -107,6 +107,10 @@ static int vb_decode_framedata(VBDecContext *c, int offset)
blk2 = 0;
for (blk = 0; blk < blocks; blk++) {
if (!(blk & 3)) {
if (bytestream2_get_bytes_left(&g) < 1) {
av_log(c->avctx, AV_LOG_ERROR, "Insufficient data\n");
return AVERROR_INVALIDDATA;
}
blocktypes = bytestream2_get_byte(&g);
}
switch (blocktypes & 0xC0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment