Commit 28230a69 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/clearvideo: Fix runtime error: signed integer overflow: 181 * 18050756...

avcodec/clearvideo: Fix runtime error: signed integer overflow: 181 * 18050756 cannot be represented in type 'int'

Fixes: 1417/clusterfuzz-testcase-minimized-6606778030620672

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 159fb8ff
...@@ -189,8 +189,8 @@ static inline int decode_block(CLVContext *ctx, int16_t *blk, int has_ac, ...@@ -189,8 +189,8 @@ static inline int decode_block(CLVContext *ctx, int16_t *blk, int has_ac,
const int t7 = ((blk[0 * step] - blk[4 * step]) * (1 << dshift)) + bias; \ const int t7 = ((blk[0 * step] - blk[4 * step]) * (1 << dshift)) + bias; \
const int t8 = t0 + t2; \ const int t8 = t0 + t2; \
const int t9 = t0 - t2; \ const int t9 = t0 - t2; \
const int tA = 181 * (t9 + (t1 - t3)) + 0x80 >> 8; \ const int tA = (int)(181U * (t9 + (t1 - t3)) + 0x80) >> 8; \
const int tB = 181 * (t9 - (t1 - t3)) + 0x80 >> 8; \ const int tB = (int)(181U * (t9 - (t1 - t3)) + 0x80) >> 8; \
const int tC = t1 + t3; \ const int tC = t1 + t3; \
\ \
blk[0 * step] = (t6 + t5 + t8) >> shift; \ blk[0 * step] = (t6 + t5 + t8) >> shift; \
......
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