avcodec/utvideodec: fix decoding odd sizes with interlaced video with some formats
authorPaul B Mahol <onemda@gmail.com>
Fri, 21 Apr 2017 10:27:17 +0000 (12:27 +0200)
committerPaul B Mahol <onemda@gmail.com>
Fri, 21 Apr 2017 10:55:30 +0000 (12:55 +0200)
Fixes #6316.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/utvideodec.c

index a49cae8..25e32a6 100644 (file)
@@ -238,7 +238,7 @@ static int decode_plane(UtvideoContext *c, int plane_no,
     VLC vlc;
     GetBitContext gb;
     int prev, fsym;
-    const int cmask = ~(!plane_no && c->avctx->pix_fmt == AV_PIX_FMT_YUV420P);
+    const int cmask = c->interlaced ? ~(1 + 2 * (!plane_no && c->avctx->pix_fmt == AV_PIX_FMT_YUV420P)) : ~(!plane_no && c->avctx->pix_fmt == AV_PIX_FMT_YUV420P);
 
     if (build_huff(src, &vlc, &fsym)) {
         av_log(c->avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n");