diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-08-18 16:42:58 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-09-10 01:33:28 +0200 |
commit | 253b7829e4f547ebd5b95a3154ae2e5b3f200b13 (patch) | |
tree | 6644297bc12f210c379d392fbab921b7fa584082 | |
parent | f5227c50b7396be373103a1861cd70e9bb8c81cd (diff) | |
download | ffmpeg-253b7829e4f547ebd5b95a3154ae2e5b3f200b13.tar.gz |
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/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a165b53daa8a3a526d2328ca72c4aa9e7f163045)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/dirac_dwt_template.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/dirac_dwt_template.c b/libavcodec/dirac_dwt_template.c index 972c711cff..e436c247a1 100644 --- a/libavcodec/dirac_dwt_template.c +++ b/libavcodec/dirac_dwt_template.c @@ -49,7 +49,7 @@ static void RENAME(vertical_compose53iL0)(uint8_t *_b0, uint8_t *_b1, uint8_t *_ TYPE *b1 = (TYPE *)_b1; TYPE *b2 = (TYPE *)_b2; 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, |