diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-02-19 14:34:55 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-02-19 15:58:30 +0100 |
commit | 3e1028c625e11d9d19376f5c88267de1cee8fa70 (patch) | |
tree | 687d71ab3c35a2771450ced8c03724dc39c91d5c /libavcodec/flacdec.c | |
parent | e8d4eacc07c61ae24f48451073a2620d8d257d33 (diff) | |
download | ffmpeg-3e1028c625e11d9d19376f5c88267de1cee8fa70.tar.gz |
avcodec/flac: Fix several integer overflows
Fixes: 686513-media
Found-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/flacdec.c')
-rw-r--r-- | libavcodec/flacdec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index 0fffc2dd94..6ea86d4eb1 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -326,7 +326,7 @@ static int decode_subframe_fixed(FLACContext *s, int32_t *decoded, return 0; } -static void lpc_analyze_remodulate(int32_t *decoded, const int coeffs[32], +static void lpc_analyze_remodulate(SUINT32 *decoded, const int coeffs[32], int order, int qlevel, int len, int bps) { int i, j; @@ -342,7 +342,7 @@ static void lpc_analyze_remodulate(int32_t *decoded, const int coeffs[32], for (i = len - 1; i >= order; i--) { int64_t p = 0; for (j = 0; j < order; j++) - p += coeffs[j] * (int64_t)decoded[i-order+j]; + p += coeffs[j] * (int64_t)(int32_t)decoded[i-order+j]; decoded[i] -= p >> qlevel; } for (i = order; i < len; i++, decoded++) { |