avcodec/celp_filters: Fix runtime error: signed integer overflow: 1892453989 + 381702...
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 23 May 2017 12:50:55 +0000 (14:50 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 23 May 2017 14:11:27 +0000 (16:11 +0200)
Fixes: 1766/clusterfuzz-testcase-minimized-6562020075765760

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

index a81fd88..fafedd9 100644 (file)
@@ -67,7 +67,7 @@ int ff_celp_lp_synthesis_filter(int16_t *out, const int16_t *filter_coeffs,
     for (n = 0; n < buffer_length; n++) {
         int sum = -rounder, sum1;
         for (i = 1; i <= filter_length; i++)
-            sum += filter_coeffs[i-1] * out[n-i];
+            sum += (unsigned)(filter_coeffs[i-1] * out[n-i]);
 
         sum1 = ((-sum >> 12) + in[n]) >> shift;
         sum  = av_clip_int16(sum1);