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: Martin Storsjö <martin@martin.st>
... | ... |
@@ -120,9 +120,10 @@ static void cmv_decode_inter(CmvContext *s, AVFrame *frame, const uint8_t *buf, |
120 | 120 |
}else{ /* inter using last frame as reference */ |
121 | 121 |
int xoffset = (buf[i] & 0xF) - 7; |
122 | 122 |
int yoffset = ((buf[i] >> 4)) - 7; |
123 |
- cmv_motcomp(frame->data[0], frame->linesize[0], |
|
124 |
- s->last_frame->data[0], s->last_frame->linesize[0], |
|
125 |
- x*4, y*4, xoffset, yoffset, s->avctx->width, s->avctx->height); |
|
123 |
+ if (s->last_frame->data[0]) |
|
124 |
+ cmv_motcomp(frame->data[0], frame->linesize[0], |
|
125 |
+ s->last_frame->data[0], s->last_frame->linesize[0], |
|
126 |
+ x*4, y*4, xoffset, yoffset, s->avctx->width, s->avctx->height); |
|
126 | 127 |
} |
127 | 128 |
i++; |
128 | 129 |
} |