avcodec/svq3: set last/next frames to defaults before use

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-12-17 14:54:29 +01:00
parent 5abdda214d
commit c5f7c8f9a9
1 changed files with 2 additions and 0 deletions

View File

@ -1187,6 +1187,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
if (h->pict_type != AV_PICTURE_TYPE_I) {
if (!s->last_pic->f.data[0]) {
av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
av_frame_unref(s->last_pic);
ret = get_buffer(avctx, s->last_pic);
if (ret < 0)
return ret;
@ -1199,6 +1200,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
if (h->pict_type == AV_PICTURE_TYPE_B && !s->next_pic->f.data[0]) {
av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
av_frame_unref(s->next_pic);
ret = get_buffer(avctx, s->next_pic);
if (ret < 0)
return ret;