eacmv: Make sure a reference frame exists before referencing it
This is similar to an existing check for the second-last frame from062421e3
. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commitea78a348d8
) Signed-off-by: Luca Barbato <lu_zero@gentoo.org> Conflicts: libavcodec/eacmv.c
This commit is contained in:

committed by
Luca Barbato

parent
c8c93795e4
commit
2e12af4587
@@ -108,9 +108,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++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user