Commit 113d7be6 authored by Laurent Aimar's avatar Laurent Aimar Committed by Michael Niedermayer

Prevent NULL dereferences when missing the reference frame in the Electronic Arts CMV decoder.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e9064c9c
......@@ -110,9 +110,10 @@ static void cmv_decode_inter(CmvContext * s, const uint8_t *buf, const uint8_t *
}else{ /* inter using last frame as reference */
int xoffset = (buf[i] & 0xF) - 7;
int yoffset = ((buf[i] >> 4)) - 7;
cmv_motcomp(s->frame.data[0], s->frame.linesize[0],
s->last_frame.data[0], s->last_frame.linesize[0],
x*4, y*4, xoffset, yoffset, s->avctx->width, s->avctx->height);
if (s->last_frame.data[0])
cmv_motcomp(s->frame.data[0], s->frame.linesize[0],
s->last_frame.data[0], s->last_frame.linesize[0],
x*4, y*4, xoffset, yoffset, s->avctx->width, s->avctx->height);
}
i++;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment