avcodec/dss_sp: Fix runtime error: signed integer overflow: 2147481189 + 4096 cannot...
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 10 May 2017 16:51:58 +0000 (18:51 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 10 May 2017 19:32:53 +0000 (21:32 +0200)
Fixes: 1441/clusterfuzz-testcase-minimized-6223152357048320

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

index 2100936..14025fc 100644 (file)
@@ -529,7 +529,7 @@ static void dss_sp_shift_sq_sub(const int32_t *filter_buf,
         for (i = 14; i > 0; i--)
             error_buf[i] = error_buf[i - 1];
 
-        tmp = (tmp + 4096) >> 13;
+        tmp = (int)(tmp + 4096U) >> 13;
 
         error_buf[1] = tmp;