avcodec/vc1: fix check for missing CBPTAB
authorJerome Borsboom <jerome.borsboom@carpalis.nl>
Wed, 20 Jun 2018 13:17:34 +0000 (15:17 +0200)
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>
Thu, 28 Jun 2018 23:19:10 +0000 (01:19 +0200)
CBPTAB must be present in (non skipped) P and B pictures.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
libavcodec/vc1dec.c

index fdbc852..9519864 100644 (file)
@@ -1088,7 +1088,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
                 av_log(v->s.avctx, AV_LOG_ERROR, "end mb y %d %d invalid\n", s->end_mb_y, s->start_mb_y);
                 continue;
             }
-            if (!v->p_frame_skipped && s->pict_type != AV_PICTURE_TYPE_I && !v->cbpcy_vlc) {
+            if (((s->pict_type == AV_PICTURE_TYPE_P && !v->p_frame_skipped) ||
+                 (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type)) &&
+                !v->cbpcy_vlc) {
                 av_log(v->s.avctx, AV_LOG_ERROR, "missing cbpcy_vlc\n");
                 continue;
             }