avcodec/mpeg4videodec: Fix GMC with videos of dimension 1
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 24 Jun 2017 11:45:35 +0000 (13:45 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 19 Jul 2017 13:26:37 +0000 (15:26 +0200)
Fixes: runtime error: shift exponent -1 is negative
Fixes: 2338/clusterfuzz-testcase-minimized-5153426541379584

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 4976a3411f71518d17a57e373b62517f066648fd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/mpeg4videodec.c

index d2f22dd..89c4b36 100644 (file)
@@ -171,7 +171,7 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
     int a     = 2 << s->sprite_warping_accuracy;
     int rho   = 3  - s->sprite_warping_accuracy;
     int r     = 16 / a;
-    int alpha = 0;
+    int alpha = 1;
     int beta  = 0;
     int w     = s->width;
     int h     = s->height;