avcodec/snowdec: Fix runtime error: left shift of negative value -1
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 11 Jun 2017 12:34:54 +0000 (14:34 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 11 Jun 2017 13:22:07 +0000 (15:22 +0200)
Fixes: 2197/clusterfuzz-testcase-minimized-6010716676947968

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/snowdec.c

index 6cf15c5..c80901b 100644 (file)
@@ -584,7 +584,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
                 for(; yq<slice_h && yq<h; yq++){
                     IDWTELEM * line = slice_buffer_get_line(&s->sb, yq);
                     for(x=0; x<w; x++){
-                        line[x] <<= FRAC_BITS;
+                        line[x] *= 1<<FRAC_BITS;
                     }
                 }
             }