History

avcodec/h264idct_template: Fix integer overflows in ff_h264_idct8_add()

Fixes: runtime error: signed integer overflow: -503316480 + -2013265038 cannot be represented in type 'int' Fixes: 3805/clusterfuzz-testcase-minimized-6578427831255040

Michael Niedermayer committed 9 years ago

Commit e131b8c1 parent e06bdc31 file · +4 −4Browse files

Unified · Split

libavcodec/h264idct_template.c+4−4
@@ -91,10 +91,10 @@ void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, int16_t *_block, int stride){ · 90 unmodified lines
9191 const int a5 = -block[i+1*8] + (unsigned)block[i+7*8] + block[i+5*8] + (block[i+5*8]>>1);
9292 const int a7 = block[i+3*8] + (unsigned)block[i+5*8] + block[i+1*8] + (block[i+1*8]>>1);
9393
94− const int b1 = (a7>>2) + a1;
95− const int b3 = a3 + (a5>>2);
96− const int b5 = (a3>>2) - a5;
97− const int b7 = a7 - (a1>>2);
94+ const int b1 = (a7>>2) + (unsigned)a1;
95+ const int b3 = (unsigned)a3 + (a5>>2);
96+ const int b5 = (a3>>2) - (unsigned)a5;
97+ const int b7 = (unsigned)a7 - (a1>>2);
9898
9999 block[i+0*8] = b0 + b7;
100100 block[i+7*8] = b0 - b7;

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