summaryrefslogtreecommitdiffstats
path: root/libavcodec/diracdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-07-26 20:26:43 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-07-28 03:35:22 +0200
commit8e275a74b09cc87f4334ed572f919b7647d4bea1 (patch)
tree06c9f861e14f184cab1118027ed8f2c4e9be8445 /libavcodec/diracdec.c
parentaeddb3607be94b1d6fef41b602b07f08223ea565 (diff)
downloadffmpeg-streaming-8e275a74b09cc87f4334ed572f919b7647d4bea1.zip
ffmpeg-streaming-8e275a74b09cc87f4334ed572f919b7647d4bea1.tar.gz
avcodec/diracdec: Fix integer overflow in signed multiplication in UNPACK_ARITH()
Fixes: runtime error: signed integer overflow: 1073741823 * 4 cannot be represented in type 'int' Fixes: 2729/clusterfuzz-testcase-minimized-5902915464069120 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/diracdec.c')
-rw-r--r--libavcodec/diracdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 71d0ff4..d2262eb 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -454,7 +454,8 @@ static inline int coeff_unpack_golomb(GetBitContext *gb, int qfactor, int qoffse
static inline void coeff_unpack_arith_##n(DiracArith *c, int qfactor, int qoffset, \
SubBand *b, type *buf, int x, int y) \
{ \
- int coeff, sign, sign_pred = 0, pred_ctx = CTX_ZPZN_F1; \
+ int sign, sign_pred = 0, pred_ctx = CTX_ZPZN_F1; \
+ unsigned coeff; \
const int mstride = -(b->stride >> (1+b->pshift)); \
if (b->parent) { \
const type *pbuf = (type *)b->parent->ibuf; \
OpenPOWER on IntegriCloud