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> (cherry picked from commit 161d0aa2a8d18f1f8a01cbc4c1061eadcbe592e5) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
4d9530afdf
commit
9e46b70436
@ -224,8 +224,8 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed, c
|
|||||||
v = abs(err);
|
v = abs(err);
|
||||||
if (v > err_inf)
|
if (v > err_inf)
|
||||||
err_inf = v;
|
err_inf = v;
|
||||||
err2_matrix[i] += v * v;
|
err2_matrix[i] += v * (int64_t)v;
|
||||||
err2 += v * v;
|
err2 += v * (int64_t)v;
|
||||||
sysErr[i] += block[i] - block1[i];
|
sysErr[i] += block[i] - block1[i];
|
||||||
blockSumErr += v;
|
blockSumErr += v;
|
||||||
if (abs(block[i]) > maxout)
|
if (abs(block[i]) > maxout)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user