Commit 6871df02 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mpeg4videodec: Check sprite_offset in addition to shifts

Fixes: 651/clusterfuzz-testcase-5710668915277824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 5a8fec1b
......@@ -368,8 +368,13 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
int shift_y = 16 - ctx->sprite_shift[0];
int shift_c = 16 - ctx->sprite_shift[1];
if (shift_c < 0 || shift_y < 0) {
avpriv_request_sample(s->avctx, "Too large sprite shift");
if (shift_c < 0 || shift_y < 0 ||
FFABS(s->sprite_offset[0][0]) >= INT_MAX >> shift_y ||
FFABS(s->sprite_offset[1][0]) >= INT_MAX >> shift_c ||
FFABS(s->sprite_offset[0][1]) >= INT_MAX >> shift_y ||
FFABS(s->sprite_offset[1][1]) >= INT_MAX >> shift_c
) {
avpriv_request_sample(s->avctx, "Too large sprite shift or offset");
return AVERROR_PATCHWELCOME;
}
......
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