avcodec/dnxhdenc: interlaced is not supported in DNxHR
authorPaul B Mahol <onemda@gmail.com>
Thu, 6 Sep 2018 11:43:20 +0000 (13:43 +0200)
committerPaul B Mahol <onemda@gmail.com>
Thu, 6 Sep 2018 11:47:48 +0000 (13:47 +0200)
Fixes #7263.

libavcodec/dnxhdenc.c

index 5135eed..9325f38 100644 (file)
@@ -473,6 +473,12 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
         ctx->m.mb_height /= 2;
     }
 
+    if (ctx->interlaced && ctx->profile != FF_PROFILE_DNXHD) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Interlaced encoding is not supported for DNxHR profiles.\n");
+        return AVERROR(EINVAL);
+    }
+
     ctx->m.mb_num = ctx->m.mb_height * ctx->m.mb_width;
 
     if (ctx->cid_table->frame_size == DNXHD_VARIABLE) {