From 507fdcd1b09deed0cfd274d6afb284a99963168f Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Wed, 25 Aug 2021 22:36:32 +0200 Subject: [PATCH] avcodec/dnxhddec: ignore second flag for encoded field And instead use previous field flag. Fixes decoding files produced by non-compliant encoders. --- libavcodec/dnxhddec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 41c72cdce6..d113c1db7b 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -193,7 +193,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, return AVERROR_INVALIDDATA; } if (buf[5] & 2) { /* interlaced */ - ctx->cur_field = buf[5] & 1; + ctx->cur_field = first_field ? buf[5] & 1 : !ctx->cur_field; frame->interlaced_frame = 1; frame->top_field_first = first_field ^ ctx->cur_field; av_log(ctx->avctx, AV_LOG_DEBUG,