png: make sure the previous frames dimensions match before using it as reference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-04-15 17:41:17 +02:00
parent a9e7e98021
commit c7dc19d68f

View File

@ -675,7 +675,10 @@ static int decode_frame(AVCodecContext *avctx,
/* handle p-frames only if a predecessor frame is available */
if(s->last_picture->data[0] != NULL) {
if(!(avpkt->flags & AV_PKT_FLAG_KEY)) {
if( !(avpkt->flags & AV_PKT_FLAG_KEY)
&& s->last_picture->width == s->current_picture->width
&& s->last_picture->height== s->current_picture->height
) {
int i, j;
uint8_t *pd = s->current_picture->data[0];
uint8_t *pd_last = s->last_picture->data[0];