Commit 575d8ca0 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/dirac_dwt_template: Fix undefined behavior in interleave()

Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 8697/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5197148130902016

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent aa41d322
...@@ -57,8 +57,8 @@ static av_always_inline void RENAME(interleave)(TYPE *dst, TYPE *src0, TYPE *src ...@@ -57,8 +57,8 @@ static av_always_inline void RENAME(interleave)(TYPE *dst, TYPE *src0, TYPE *src
{ {
int i; int i;
for (i = 0; i < w2; i++) { for (i = 0; i < w2; i++) {
dst[2*i ] = (src0[i] + add) >> shift; dst[2*i ] = (src0[i] + (unsigned)add) >> shift;
dst[2*i+1] = (src1[i] + add) >> shift; dst[2*i+1] = (src1[i] + (unsigned)add) >> 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