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
27db6dceb5
commit
df0575dc21
|
@ -344,8 +344,10 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
|
|||
pic->reference = 3;
|
||||
}
|
||||
|
||||
if (alloc_picture(s, pic) < 0)
|
||||
if (alloc_picture(s, pic) < 0) {
|
||||
s->current_picture_ptr = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
s->current_picture_ptr = pic;
|
||||
// FIXME use only the vars from current_pic
|
||||
|
|
Loading…
Reference in New Issue