Browse Source

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>
(cherry picked from commit 8e275a74b0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.1.10
Michael Niedermayer 8 years ago
parent
commit
f4c8449238
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavcodec/diracdec.c

+ 2
- 1
libavcodec/diracdec.c View File

@@ -462,7 +462,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; \


Loading…
Cancel
Save