]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cavsdec.c
lavf/movenc: Fail when codec tag is invalid for format
[ffmpeg] / libavcodec / cavsdec.c
index 06c752735eceff846b5b33d2a74b0d07315764f4..c7fff67c06c660ce31e11b7d3aea8cf8b5b725a7 100644 (file)
@@ -1067,6 +1067,11 @@ static int decode_pic(AVSContext *h)
     if (!h->loop_filter_disable && get_bits1(&h->gb)) {
         h->alpha_offset        = get_se_golomb(&h->gb);
         h->beta_offset         = get_se_golomb(&h->gb);
+        if (   h->alpha_offset < -64 || h->alpha_offset > 64
+            || h-> beta_offset < -64 || h-> beta_offset > 64) {
+            h->alpha_offset = h->beta_offset  = 0;
+            return AVERROR_INVALIDDATA;
+        }
     } else {
         h->alpha_offset = h->beta_offset  = 0;
     }