summaryrefslogtreecommitdiff
path: root/libavcodec/dirac_dwt.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-09-18 02:53:25 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-09-22 12:19:07 +0200
commit67da2685e03805230207daab83ab43a390fbb887 (patch)
tree0be62aec68506dda6fee0d03ae83649186914213 /libavcodec/dirac_dwt.h
parentd00fc952b6c261dd8eb0f7552b9ccf985dbc2b20 (diff)
avcodec/dirac_dwt: Fix integer overflow in COMPOSE_FIDELITYi*()
Fixes: runtime error: signed integer overflow: 161 * 13872281 cannot be represented in type 'int' Fixes: 3295/clusterfuzz-testcase-minimized-4738998142500864 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dirac_dwt.h')
-rw-r--r--libavcodec/dirac_dwt.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/dirac_dwt.h b/libavcodec/dirac_dwt.h
index adf5178714..755d5e5d2d 100644
--- a/libavcodec/dirac_dwt.h
+++ b/libavcodec/dirac_dwt.h
@@ -111,10 +111,10 @@ void ff_spatial_idwt_slice2(DWTContext *d, int y);
(b0 + b1)
#define COMPOSE_FIDELITYiL0(b0, b1, b2, b3, b4, b5, b6, b7, b8)\
- (b4 - ((-8*(b0+b8) + 21*(b1+b7) - 46*(b2+b6) + 161*(b3+b5) + 128) >> 8))
+ (b4 - ((int)(-8*(b0+(unsigned)b8) + 21*(b1+(unsigned)b7) - 46*(b2+(unsigned)b6) + 161*(b3+(unsigned)b5) + 128) >> 8))
#define COMPOSE_FIDELITYiH0(b0, b1, b2, b3, b4, b5, b6, b7, b8)\
- (b4 + ((-2*(b0+b8) + 10*(b1+b7) - 25*(b2+b6) + 81*(b3+b5) + 128) >> 8))
+ (b4 + ((int)(-2*(b0+(unsigned)b8) + 10*(b1+(unsigned)b7) - 25*(b2+(unsigned)b6) + 81*(b3+(unsigned)b5) + 128) >> 8))
#define COMPOSE_DAUB97iL1(b0, b1, b2)\
(b1 - ((int)(1817*(b0 + (unsigned)b2) + 2048) >> 12))