1
0
Fork 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 27db6dceb5
commit df0575dc21
Signed by: hendrik
GPG Key ID: 846079A4B0A7C1B5
1 changed files with 3 additions and 1 deletions

View File

@ -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