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>
Sat, 28 Mar 2015 10:59:04 +0000 (11:59 +0100)
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 4335977..2de2566 100644 (file)
@@ -373,7 +373,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
     dest_u = frame->data[1] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->is_444));
     dest_v = frame->data[2] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->is_444));
 
-    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];