1
0

mpegvideo: null out current_picture_ptr when allocation failed

This avoids using an uninitialized picture in further decode calls.
This commit is contained in:
Hendrik Leppkes 2012-07-20 23:03:32 +02:00
parent 9124e149b2
commit a0703fa5c7
Signed by: hendrik
GPG Key ID: 846079A4B0A7C1B5

View File

@ -355,8 +355,10 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
ff_mpv_unref_picture(&s->cur_pic);
ret = alloc_picture(s, &s->cur_pic,
s->pict_type != AV_PICTURE_TYPE_B && !s->droppable);
if (ret < 0)
if (ret < 0) {
ff_mpv_unref_picture(&s->cur_pic);
return ret;
}
s->cur_pic.ptr->f->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST * !!s->top_field_first;
s->cur_pic.ptr->f->flags |= AV_FRAME_FLAG_INTERLACED *