avcodec/dca_xll: Fix runtime error: signed integer overflow: 2147286116 + 6298923...
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 8 Mar 2017 20:35:51 +0000 (21:35 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 12 Mar 2017 03:38:14 +0000 (04:38 +0100)
Fixes: 732/clusterfuzz-testcase-4872990070145024

See: [FFmpeg-devel] [PATCH 2/6] avcodec/dca_xll: Fix runtime error: signed integer overflow: 2147286116 + 6298923 cannot be represented in type 'int'
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/dca_xll.c

index b7331e0..38a1999 100644 (file)
@@ -1312,7 +1312,7 @@ static int combine_residual_frame(DCAXllDecoder *s, DCAXllChSet *c)
         } else {
             // No downmix scaling
             for (n = 0; n < nsamples; n++)
-                dst[n] += (src[n] + round) >> shift;
+                dst[n] += (unsigned)((src[n] + round) >> shift);
         }
     }