OSDN Git Service

avcodec/pixlet: Fix runtime error: signed integer overflow: 436207616 * -516023054526...
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 10 May 2017 21:48:30 +0000 (23:48 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 10 May 2017 22:02:41 +0000 (00:02 +0200)
Fixes: 1462/clusterfuzz-testcase-minimized-6558894463647744

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

index d031305..ccfd267 100644 (file)
@@ -256,7 +256,7 @@ static int read_high_coeffs(AVCodecContext *avctx, uint8_t *src, int16_t *dst, i
             j = 0;
             dst += stride;
         }
-        state += (int64_t)d * yflag - (d * state >> 8);
+        state += (int64_t)d * yflag - ((int64_t)(d * (uint64_t)state) >> 8);
 
         flag = 0;