History

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

Fixes: CID1500284 Unintentional integer overflow

Michael Niedermayer committed 2 years ago

Commit 161d0aa1 parent d7416381 file · +2 −2Browse files

Unified · Split

libavcodec/tests/dct.c+2−2
@@ -226,8 +226,8 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed, c · 225 unmodified lines
226 v = abs(err);226 v = abs(err);
227 if (v > err_inf)227 if (v > err_inf)
228 err_inf = v;228 err_inf = v;
229 err2_matrix[i] += v * v;229 err2_matrix[i] += v * (int64_t)v;
230 err2 += v * v;230 err2 += v * (int64_t)v;
231 sysErr[i] += block[i] - block1[i];231 sysErr[i] += block[i] - block1[i];
232 blockSumErr += v;232 blockSumErr += v;
233 if (abs(block[i]) > maxout)233 if (abs(block[i]) > maxout)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t