aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-08-15 03:32:43 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-17 00:27:32 +0200
commitb463a0347636fce1a55a6fcaeb4d8827d2929f2c (patch)
tree23fc90e48d5480ac1ecbacc998b4b33eb3847c92
parent96cf249751bb764199aa9a9c50bbd7f4724889cb (diff)
downloadffmpeg-b463a0347636fce1a55a6fcaeb4d8827d2929f2c.tar.gz
avcodec/diracdec: Check perspective_exp and zrs_exp.
Fixes: undefined shift Fixes: runtime error: shift exponent 264 is too large for 32-bit type 'int' Fixes: 2860/clusterfuzz-testcase-minimized-4672811689836544 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 1e6cab874512070b36267a5a53fd053f90072fa2) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/diracdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index a718f00992..0979b8ee78 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -960,6 +960,10 @@ static int dirac_unpack_prediction_parameters(DiracContext *s)
s->globalmc[ref].perspective[0] = dirac_get_se_golomb(gb);
s->globalmc[ref].perspective[1] = dirac_get_se_golomb(gb);
}
+ if (s->globalmc[ref].perspective_exp + (uint64_t)s->globalmc[ref].zrs_exp > 30) {
+ return AVERROR_INVALIDDATA;
+ }
+
}
}