Skip to content
Snippets Groups Projects
Commit ea78a348 authored by Martin Storsjö's avatar Martin Storsjö
Browse files

eacmv: Make sure a reference frame exists before referencing it


This is similar to an existing check for the second-last frame
from 062421e3.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: default avatarMartin Storsjö <martin@martin.st>
parent c39f7eba
No related branches found
No related tags found
No related merge requests found
...@@ -120,9 +120,10 @@ static void cmv_decode_inter(CmvContext *s, AVFrame *frame, const uint8_t *buf, ...@@ -120,9 +120,10 @@ static void cmv_decode_inter(CmvContext *s, AVFrame *frame, const uint8_t *buf,
}else{ /* inter using last frame as reference */ }else{ /* inter using last frame as reference */
int xoffset = (buf[i] & 0xF) - 7; int xoffset = (buf[i] & 0xF) - 7;
int yoffset = ((buf[i] >> 4)) - 7; int yoffset = ((buf[i] >> 4)) - 7;
cmv_motcomp(frame->data[0], frame->linesize[0], if (s->last_frame->data[0])
s->last_frame->data[0], s->last_frame->linesize[0], cmv_motcomp(frame->data[0], frame->linesize[0],
x*4, y*4, xoffset, yoffset, s->avctx->width, s->avctx->height); s->last_frame->data[0], s->last_frame->linesize[0],
x*4, y*4, xoffset, yoffset, s->avctx->width, s->avctx->height);
} }
i++; i++;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment