mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-18 12:56:56 +00:00
avcodec/mpeg4videodec: Fix runtime error: shift exponent -2 is negative
Fixes: 612/clusterfuzz-testcase-4707817137111040
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit aa2b75263e
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
0171371298
commit
0d05a80c2b
@ -364,6 +364,12 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
|
||||
} else {
|
||||
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");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
s->sprite_offset[0][i] *= 1 << shift_y;
|
||||
s->sprite_offset[1][i] *= 1 << shift_c;
|
||||
|
Loading…
Reference in New Issue
Block a user