avcodec/alac: Fix integer overflow in LPC coefficient adaption
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 7 Dec 2019 19:42:54 +0000 (20:42 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 11 Jan 2020 22:31:18 +0000 (23:31 +0100)
Fixes: signed integer overflow: 267693597 * 10 cannot be represented in type 'int'
Fixes: 19237/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5755407700328448

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

index d08c946..ea5ab18 100644 (file)
@@ -228,7 +228,7 @@ static void lpc_prediction(int32_t *error_buffer, uint32_t *buffer_out,
                 sign = sign_only(val) * error_sign;
                 lpc_coefs[j] -= sign;
                 val *= (unsigned)sign;
-                error_val -= (val >> lpc_quant) * (j + 1);
+                error_val -= (val >> lpc_quant) * (j + 1U);
             }
         }
     }