Browse Source

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>
tags/n0.11
Michael Niedermayer 14 years ago
parent
commit
c7dc19d68f
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      libavcodec/pngdec.c

+ 4
- 1
libavcodec/pngdec.c 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];


Loading…
Cancel
Save