Browse Source

avcodec/mpeg4videodec: Fix undefined shift in get_amv()

Fixes: runtime error: shift exponent -1 is negative
Fixes: 9938/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5653783529914368

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c88afa44c4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.3.9
Michael Niedermayer 7 years ago
parent
commit
43a80efee6
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/mpeg4videodec.c

+ 1
- 1
libavcodec/mpeg4videodec.c View File

@@ -539,7 +539,7 @@ static inline int get_amv(Mpeg4DecContext *ctx, int n)
len >>= s->quarter_sample; len >>= s->quarter_sample;


if (s->real_sprite_warping_points == 1) { if (s->real_sprite_warping_points == 1) {
if (ctx->divx_version == 500 && ctx->divx_build == 413)
if (ctx->divx_version == 500 && ctx->divx_build == 413 && a >= s->quarter_sample)
sum = s->sprite_offset[0][n] / (1 << (a - s->quarter_sample)); sum = s->sprite_offset[0][n] / (1 << (a - s->quarter_sample));
else else
sum = RSHIFT(s->sprite_offset[0][n] * (1 << s->quarter_sample), a); sum = RSHIFT(s->sprite_offset[0][n] * (1 << s->quarter_sample), a);


Loading…
Cancel
Save