pngdec: check that format matches too not just dimensions
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 9 Nov 2012 18:58:37 +0000 (19:58 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 9 Nov 2012 18:59:05 +0000 (19:59 +0100)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/pngdec.c

index fb4a018..c1b8b08 100644 (file)
@@ -825,6 +825,7 @@ static int decode_frame(AVCodecContext *avctx,
          if(   !(avpkt->flags & AV_PKT_FLAG_KEY)
             && s->last_picture->width == s->current_picture->width
             && s->last_picture->height== s->current_picture->height
+            && s->last_picture->format== s->current_picture->format
          ) {
             int i, j;
             uint8_t *pd = s->current_picture->data[0];