avcodec/bmvvideo: Fix runtime error: left shift of 137 by 24 places cannot be represe...
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 8 May 2017 13:46:55 +0000 (15:46 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 8 May 2017 13:47:29 +0000 (15:47 +0200)
Fixes: 1411/clusterfuzz-testcase-minimized-5776085184675840

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

index 78a0945..679b142 100644 (file)
@@ -107,7 +107,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
                     if (src < source || src >= source_end)
                         return AVERROR_INVALIDDATA;
                     shift += 2;
-                    val |= *src << shift;
+                    val |= (unsigned)*src << shift;
                     if (*src & 0xC)
                         break;
                 }