mpegvideo: null out current_picture_ptr when allocation failed
This avoids using an uninitialized picture in further decode calls.
This commit is contained in:
parent
9124e149b2
commit
a0703fa5c7
@ -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 *
|
||||
|
Loading…
Reference in New Issue
Block a user