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>
release/7.1
Michael Niedermayer 6 months ago
parent d741638042
commit 161d0aa2a8
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 4
      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)

Loading…
Cancel
Save