Browse code

avcodec/dnxhddec: Check that the frame is interlaced before using cur_field

Fixes Ticket4227

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2015/03/20 07:28:39
Showing 1 changed files
... ...
@@ -363,7 +363,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
363 363
     dest_u = frame->data[1] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->is_444));
364 364
     dest_v = frame->data[2] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->is_444));
365 365
 
366
-    if (ctx->cur_field) {
366
+    if (frame->interlaced_frame && ctx->cur_field) {
367 367
         dest_y += frame->linesize[0];
368 368
         dest_u += frame->linesize[1];
369 369
         dest_v += frame->linesize[2];