avcodec/pngdec: apng: fix output buffer filling when no blending is needed.
authorBenoit Fouet <benoit.fouet@free.fr>
Fri, 28 Nov 2014 15:54:09 +0000 (16:54 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 28 Nov 2014 16:55:18 +0000 (17:55 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/pngdec.c

index a330d36..9e52d0b 100644 (file)
@@ -927,7 +927,17 @@ static int handle_p_frame_apng(AVCodecContext *avctx, PNGDecContext *s,
             pd      += s->image_linesize;
             pd_last += s->image_linesize;
         }
+    } else {
+        for (j = s->y_offset; j < s->y_offset + s->cur_h; j++) {
+            for (i = 0; i < s->x_offset * s->bpp; i++)
+                pd[i] = pd_last[i];
+            for (i = (s->x_offset + s->cur_w) * s->bpp; i < ls; i++)
+                pd[i] = pd_last[i];
+            pd      += s->image_linesize;
+            pd_last += s->image_linesize;
+        }
     }
+
     for (j = s->y_offset + s->cur_h; j < s->height; j++) {
         for (i = 0; i < ls; i++)
             pd[i] = pd_last[i];