avcodec/ffv1dec_template: Fix runtime error: signed integer overflow: 202 + 214748361...
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 23 May 2017 01:24:49 +0000 (03:24 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 23 May 2017 01:25:21 +0000 (03:25 +0200)
Fixes: 1748/clusterfuzz-testcase-minimized-6690208340770816

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

index 21af155..36cfba9 100644 (file)
@@ -98,7 +98,7 @@ static av_always_inline void RENAME(decode_line)(FFV1Context *s, int w,
         if (sign)
             diff = -diff;
 
-        sample[1][x] = av_mod_uintp2(RENAME(predict)(sample[1] + x, sample[0] + x) + diff, bits);
+        sample[1][x] = av_mod_uintp2(RENAME(predict)(sample[1] + x, sample[0] + x) + (SUINT)diff, bits);
     }
     s->run_index = run_index;
 }