mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-27 18:02:11 +00:00
avcodec/h264idct_template: Fix integer overflows in ff_h264_idct8_add()
Fixes: runtime error: signed integer overflow: 924846844 + 1457520640 cannot be represented in type 'int' Fixes: 3416/clusterfuzz-testcase-minimized-6125587682820096 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
e8fafef1db
commit
2b739e1cb8
@ -107,10 +107,10 @@ void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, int16_t *_block, int stride){
|
||||
}
|
||||
for( i = 0; i < 8; i++ )
|
||||
{
|
||||
const unsigned a0 = block[0+i*8] + block[4+i*8];
|
||||
const unsigned a2 = block[0+i*8] - block[4+i*8];
|
||||
const unsigned a4 = (block[2+i*8]>>1) - block[6+i*8];
|
||||
const unsigned a6 = (block[6+i*8]>>1) + block[2+i*8];
|
||||
const unsigned a0 = block[0+i*8] + (unsigned)block[4+i*8];
|
||||
const unsigned a2 = block[0+i*8] - (unsigned)block[4+i*8];
|
||||
const unsigned a4 = (block[2+i*8]>>1) - (unsigned)block[6+i*8];
|
||||
const unsigned a6 = (block[6+i*8]>>1) + (unsigned)block[2+i*8];
|
||||
|
||||
const unsigned b0 = a0 + a6;
|
||||
const unsigned b2 = a2 + a4;
|
||||
|
Loading…
Reference in New Issue
Block a user