Commit 97450d2b authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/dxv: Check op_offset in dxv_decompress_yo()

Fixes: signed integer overflow: -2147483648 - 8 cannot be represented in type 'int'
Fixes: 17745/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_fuzzer-5734628463214592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegReviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 75fefb1f
......@@ -799,6 +799,9 @@ static int dxv_decompress_yo(DXVContext *ctx, GetByteContext *gb,
uint8_t *dst, *table0[256] = { 0 }, *table1[256] = { 0 };
int ret, state = 0, skip, oi = 0, v, vv;
if (op_offset < 8 || op_offset - 8 > bytestream2_get_bytes_left(gb))
return AVERROR_INVALIDDATA;
dst = tex_data;
bytestream2_skip(gb, op_offset - 8);
if (op_size > max_op_size)
......
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