Set png_ptr->old_prev_row_size=0 in pngpread.c and pngrutil.c
This forces the prev_row array to be cleared before the first
row of each image and interlace pass.
diff --git a/pngpread.c b/pngpread.c
index c127435..1cb036d 100644
--- a/pngpread.c
+++ b/pngpread.c
@@ -1110,11 +1110,12 @@
if (png_ptr->row_number < png_ptr->num_rows)
return;
+ png_ptr->old_prev_row_size = 0; /* Force prev_row to be cleared */
+
+#if defined(PNG_READ_INTERLACING_SUPPORTED)
if (png_ptr->interlaced)
{
png_ptr->row_number = 0;
- png_memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1);
-
do
{
png_ptr->pass++;
@@ -1147,6 +1148,7 @@
} while (png_ptr->iwidth == 0 || png_ptr->num_rows == 0);
}
+#endif /* PNG_READ_INTERLACING_SUPPORTED */
}
#if defined(PNG_READ_tEXt_SUPPORTED)
diff --git a/pngrutil.c b/pngrutil.c
index d039e11..bbc6a91 100644
--- a/pngrutil.c
+++ b/pngrutil.c
@@ -2992,11 +2992,12 @@
if (png_ptr->row_number < png_ptr->num_rows)
return;
+ png_ptr->old_prev_row_size = 0; /* Force prev_row to be cleared */
+
#ifdef PNG_READ_INTERLACING_SUPPORTED
if (png_ptr->interlaced)
{
png_ptr->row_number = 0;
- png_memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1);
do
{
png_ptr->pass++;