aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/diracdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-08-15 03:32:44 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-17 00:23:01 +0200
commit92da23093c784b1d9f0db4db51d28ea80a59e759 (patch)
treedf31f507349ad40b067d4ff5a75ca5f1eb13c322 /libavcodec/diracdec.c
parent1e6cab874512070b36267a5a53fd053f90072fa2 (diff)
downloadffmpeg-92da23093c784b1d9f0db4db51d28ea80a59e759.tar.gz
avcodec/diracdec: Fixes integer overflow
Fixes: runtime error: signed integer overflow: 340018243 * 27 cannot be represented in type 'int' Fixes: 2861/clusterfuzz-testcase-minimized-5361070510178304 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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 29042bd86b..0aee08f9e1 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -442,7 +442,7 @@ static av_cold int dirac_decode_end(AVCodecContext *avctx)
static inline int coeff_unpack_golomb(GetBitContext *gb, int qfactor, int qoffset)
{
int coeff = dirac_get_se_golomb(gb);
- const int sign = FFSIGN(coeff);
+ const unsigned sign = FFSIGN(coeff);
if (coeff)
coeff = sign*((sign * coeff * qfactor + qoffset) >> 2);
return coeff;