avcodec/dnxhddec: Check that the frame is interlaced before using cur_field
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 19 Mar 2015 22:28:39 +0000 (23:28 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 10 Jun 2015 00:13:10 +0000 (02:13 +0200)
Fixes Ticket4227

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2c660e34cf3c2b77cd2bef6f292920334dfd9192)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/dnxhddec.c

index 61d7695..720f1b1 100644 (file)
@@ -312,7 +312,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame, int x, int
     dest_u = frame->data[1] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1));
     dest_v = frame->data[2] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1));
 
-    if (ctx->cur_field) {
+    if (frame->interlaced_frame && ctx->cur_field) {
         dest_y += frame->linesize[0];
         dest_u += frame->linesize[1];
         dest_v += frame->linesize[2];