From 2ddc3cbd98ea105a16738c136102ed237618eb9a Mon Sep 17 00:00:00 2001 From: Dale Curtis Date: Tue, 29 Jul 2025 22:05:19 +0000 Subject: [PATCH] avcodec/flacdsp: Fix integer-overflow in flac_lpc_33_c This fix copies a couple of casts from surrounding functions. See https://crbug.com/432528781 for stack trace details. Signed-off-by: Dale Curtis Signed-off-by: Michael Niedermayer --- libavcodec/flacdsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/flacdsp.c b/libavcodec/flacdsp.c index f5362bf66f..b5b0609716 100644 --- a/libavcodec/flacdsp.c +++ b/libavcodec/flacdsp.c @@ -94,7 +94,7 @@ static void flac_lpc_33_c(int64_t *decoded, const int32_t *residual, int64_t sum = 0; for (j = 0; j < pred_order; j++) sum += (int64_t)coeffs[j] * (uint64_t)decoded[j]; - decoded[j] = residual[i] + (sum >> qlevel); + decoded[j] = (uint64_t)residual[i] + (uint64_t)(sum >> qlevel); } }