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; + } + } }