Commit a165b53d authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/dirac_dwt_template: Fix integer overflow in vertical_compose53iL0()

Fixes: runtime error: signed integer overflow: 2147483646 + 2 cannot be represented in type 'int'
Fixes: 3013/clusterfuzz-testcase-minimized-4644084197097472

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent f5361ee5
...@@ -49,7 +49,7 @@ static void RENAME(vertical_compose53iL0)(uint8_t *_b0, uint8_t *_b1, uint8_t *_ ...@@ -49,7 +49,7 @@ static void RENAME(vertical_compose53iL0)(uint8_t *_b0, uint8_t *_b1, uint8_t *_
TYPE *b1 = (TYPE *)_b1; TYPE *b1 = (TYPE *)_b1;
TYPE *b2 = (TYPE *)_b2; TYPE *b2 = (TYPE *)_b2;
for (i = 0; i < width; i++) for (i = 0; i < width; i++)
b1[i] -= (b0[i] + b2[i] + 2) >> 2; b1[i] -= (int)(b0[i] + (unsigned)b2[i] + 2) >> 2;
} }
static av_always_inline void RENAME(interleave)(TYPE *dst, TYPE *src0, TYPE *src1, int w2, static av_always_inline void RENAME(interleave)(TYPE *dst, TYPE *src0, TYPE *src1, int w2,
......
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