mpegvideo: dont leave stale pointers in next/last picture

Fixes out of array reads

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-01-12 04:45:21 +01:00
parent cc548ea7a6
commit d9226b3717
1 changed files with 2 additions and 0 deletions

View File

@ -1496,6 +1496,8 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
}
}
memset(s->last_picture.f.data, 0, sizeof(s->last_picture.f.data));
memset(s->next_picture.f.data, 0, sizeof(s->next_picture.f.data));
if (s->last_picture_ptr)
ff_copy_picture(&s->last_picture, s->last_picture_ptr);
if (s->next_picture_ptr)