1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

avcodec/tests/dct: Use 64bit in intermediate for error computation

Fixes: CID1500284 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-05-17 00:46:24 +02:00
parent d741638042
commit 161d0aa2a8
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -226,8 +226,8 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed, c
v = abs(err);
if (v > err_inf)
err_inf = v;
err2_matrix[i] += v * v;
err2 += v * v;
err2_matrix[i] += v * (int64_t)v;
err2 += v * (int64_t)v;
sysErr[i] += block[i] - block1[i];
blockSumErr += v;
if (abs(block[i]) > maxout)