History

avcodec/fic: Fixes signed integer overflow

Fixes: runtime error: signed integer overflow: 1037142357 + 1227025305 cannot be represented in type 'int' Fixes: 3024/clusterfuzz-testcase-minimized-5885660323905536

Michael Niedermayer committed 9 years ago

Commit 0c9d5b01 parent d1326831 file · +6 −6Browse files

Unified · Split

libavcodec/fic.c+6−6
@@ -85,12 +85,12 @@ static const uint8_t fic_header[7] = { 0, 0, 1, 'F', 'I', 'C', 'V' }; · 84 unmodified lines
8585
8686 static av_always_inline void fic_idct(int16_t *blk, int step, int shift, int rnd)
8787 {
88− const int t0 = 27246 * blk[3 * step] + 18405 * blk[5 * step];
89− const int t1 = 27246 * blk[5 * step] - 18405 * blk[3 * step];
90− const int t2 = 6393 * blk[7 * step] + 32139 * blk[1 * step];
91− const int t3 = 6393 * blk[1 * step] - 32139 * blk[7 * step];
92− const unsigned t4 = 5793U * (t2 + t0 + 0x800 >> 12);
93− const unsigned t5 = 5793U * (t3 + t1 + 0x800 >> 12);
88+ const unsigned t0 = 27246 * blk[3 * step] + 18405 * blk[5 * step];
89+ const unsigned t1 = 27246 * blk[5 * step] - 18405 * blk[3 * step];
90+ const unsigned t2 = 6393 * blk[7 * step] + 32139 * blk[1 * step];
91+ const unsigned t3 = 6393 * blk[1 * step] - 32139 * blk[7 * step];
92+ const unsigned t4 = 5793U * ((int)(t2 + t0 + 0x800) >> 12);
93+ const unsigned t5 = 5793U * ((int)(t3 + t1 + 0x800) >> 12);
9494 const unsigned t6 = t2 - t0;
9595 const unsigned t7 = t3 - t1;
9696 const unsigned t8 = 17734 * blk[2 * step] - 42813 * blk[6 * step];

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