[FFmpeg-cvslog] avcodec/flacdsp: Fix integer-overflow in flac_lpc_33_c

Dale Curtis git at videolan.org
Thu Jul 31 21:25:38 EEST 2025


ffmpeg | branch: master | Dale Curtis <dalecurtis at chromium.org> | Tue Jul 29 22:05:19 2025 +0000| [2ddc3cbd98ea105a16738c136102ed237618eb9a] | committer: Michael Niedermayer

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 <dalecurtis at chromium.org>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ddc3cbd98ea105a16738c136102ed237618eb9a
---

 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);
     }
 }
 



More information about the ffmpeg-cvslog mailing list