diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2024-05-17 00:46:24 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-06-02 22:31:41 +0200 |
commit | 161d0aa2a8d18f1f8a01cbc4c1061eadcbe592e5 (patch) | |
tree | 226fe17a662a76358c527d605c57c3ef40a098c0 /libavcodec/tests | |
parent | d741638042d827aed994b819857d6587121627ab (diff) | |
download | ffmpeg-161d0aa2a8d18f1f8a01cbc4c1061eadcbe592e5.tar.gz |
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>
Diffstat (limited to 'libavcodec/tests')
-rw-r--r-- | libavcodec/tests/dct.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/tests/dct.c b/libavcodec/tests/dct.c index 010d0c1ac3..17a0814459 100644 --- a/libavcodec/tests/dct.c +++ b/libavcodec/tests/dct.c @@ -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) |