aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-09-01 19:56:11 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-09-10 01:33:28 +0200
commitfef0ccc40132b6a583ec6838e5823baf5649a83d (patch)
tree4b1c51f4c9d4466b664424cdc389a25fa17cbc67 /libavcodec
parent73427f5c7499bcc07444abced9b79df5b2a27229 (diff)
downloadffmpeg-fef0ccc40132b6a583ec6838e5823baf5649a83d.tar.gz
avcodec/dirac_dwt: Fix multiple overflows in 9/7 lifting
Fixes: runtime error: signed integer overflow: 1073901567 + 1073901567 cannot be represented in type 'int' Fixes: 3124/clusterfuzz-testcase-minimized-454643435752652 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 f71cd44147e7a914f80fcfacca46c9e7b0374362) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dirac_dwt.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/dirac_dwt.h b/libavcodec/dirac_dwt.h
index e715e53bc4..adf5178714 100644
--- a/libavcodec/dirac_dwt.h
+++ b/libavcodec/dirac_dwt.h
@@ -117,16 +117,16 @@ void ff_spatial_idwt_slice2(DWTContext *d, int y);
(b4 + ((-2*(b0+b8) + 10*(b1+b7) - 25*(b2+b6) + 81*(b3+b5) + 128) >> 8))
#define COMPOSE_DAUB97iL1(b0, b1, b2)\
- (b1 - ((int)(1817U*(b0 + b2) + 2048) >> 12))
+ (b1 - ((int)(1817*(b0 + (unsigned)b2) + 2048) >> 12))
#define COMPOSE_DAUB97iH1(b0, b1, b2)\
- (b1 - ((int)( 113U*(b0 + b2) + 64) >> 7))
+ (b1 - ((int)( 113*(b0 + (unsigned)b2) + 64) >> 7))
#define COMPOSE_DAUB97iL0(b0, b1, b2)\
- (b1 + ((int)( 217U*(b0 + b2) + 2048) >> 12))
+ (b1 + ((int)( 217*(b0 + (unsigned)b2) + 2048) >> 12))
#define COMPOSE_DAUB97iH0(b0, b1, b2)\
- (b1 + ((int)(6497U*(b0 + b2) + 2048) >> 12))
+ (b1 + ((int)(6497*(b0 + (unsigned)b2) + 2048) >> 12))
#endif /* AVCODEC_DWT_H */