avcodec/diracdec: Check perspective_exp and zrs_exp.
[ffmpeg.git] / libavcodec / diracdec.c
index a718f00..0979b8e 100644 (file)
@@ -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;
+            }
+
         }
     }