aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/flacdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-04-16 15:24:16 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2023-05-06 00:22:25 +0200
commitfd7352660be0211aabb11dc6d586836515772f81 (patch)
treeb220fe93bcc1c99cc4327bafde744e76b73833c3 /libavcodec/flacdec.c
parent885ff3b8798791eb2b0f53360a2ab4b1f9c5f6dc (diff)
downloadffmpeg-fd7352660be0211aabb11dc6d586836515772f81.tar.gz
avcodec/flacdec: Fix signed integre overflow
Fixes: signed integer overflow: 3011809745540902265 + 6323452730883571725 cannot be represented in type 'long' Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLAC_fuzzer-6687553022722048 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/flacdec.c')
-rw-r--r--libavcodec/flacdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index cc778a8dff..524a046949 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -513,7 +513,7 @@ static int decode_subframe_lpc_33bps(FLACContext *s, int64_t *decoded,
for (i = pred_order; i < s->blocksize; i++, decoded++) {
int64_t sum = 0;
for (j = 0; j < pred_order; j++)
- sum += (int64_t)coeffs[j] * decoded[j];
+ sum += (int64_t)coeffs[j] * (uint64_t)decoded[j];
decoded[j] = residual[i] + (sum >> qlevel);
}