Commit 14b6adfd authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/snowdec: Fix runtime error: signed integer overflow: 1404 * 8388608...

avcodec/snowdec: Fix runtime error: signed integer overflow: 1404 * 8388608 cannot be represented in type 'int'

Fixes: 2004/clusterfuzz-testcase-minimized-5533262866808832

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 6f35c216
...@@ -228,9 +228,9 @@ static void dequantize_slice_buffered(SnowContext *s, slice_buffer * sb, SubBand ...@@ -228,9 +228,9 @@ static void dequantize_slice_buffered(SnowContext *s, slice_buffer * sb, SubBand
for(x=0; x<w; x++){ for(x=0; x<w; x++){
int i= line[x]; int i= line[x];
if(i<0){ if(i<0){
line[x]= -((-i*qmul + qadd)>>(QEXPSHIFT)); //FIXME try different bias line[x]= -((-i*(unsigned)qmul + qadd)>>(QEXPSHIFT)); //FIXME try different bias
}else if(i>0){ }else if(i>0){
line[x]= (( i*qmul + qadd)>>(QEXPSHIFT)); line[x]= (( i*(unsigned)qmul + qadd)>>(QEXPSHIFT));
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment