diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-08-28 01:30:33 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-08-29 22:21:06 +0300 |
commit | 74429912dcd7392fae477f7a2eaa99cd36ee9a5e (patch) | |
tree | aa35458ba5ccf717b7ad965031d718858cc6cd45 | |
parent | 1a5b9b3b8eb5cec9aca0098921e7c69417eafdf0 (diff) |
avcodec/snowdec: Fix integer overflow in decode_subband_slice_buffered()
Fixes: runtime error: signed integer overflow: 267 * 8388608 cannot be represented in type 'int'
Fixes: 2743/clusterfuzz-testcase-minimized-5820652076400640
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 732f9764561558a388c05483ed6a722a5c67b05c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/snowdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c index 96c61ec3f9..526ea602bd 100644 --- a/libavcodec/snowdec.c +++ b/libavcodec/snowdec.c @@ -137,7 +137,7 @@ static inline void decode_subband_slice_buffered(SnowContext *s, SubBand *b, sli v = b->x_coeff[new_index].coeff; x = b->x_coeff[new_index++].x; while(x < w){ - register int t= ( (v>>1)*qmul + qadd)>>QEXPSHIFT; + register int t= (int)( (v>>1)*(unsigned)qmul + qadd)>>QEXPSHIFT; register int u= -(v&1); line[x] = (t^u) - u; |