Preallocate rowPointers in PNG code to avoid -Wclobbered errors
diff --git a/apps/shared/avifpng.c b/apps/shared/avifpng.c
index b34e361..5ce5177 100644
--- a/apps/shared/avifpng.c
+++ b/apps/shared/avifpng.c
@@ -14,7 +14,7 @@
     avifBool readResult = AVIF_FALSE;
     png_structp png = NULL;
     png_infop info = NULL;
-    png_bytep * rowPointers = NULL;
+    png_bytep * rowPointers = (png_bytep *)malloc(sizeof(png_bytep) * avif->height);
 
     avifRGBImage rgb;
     memset(&rgb, 0, sizeof(avifRGBImage));
@@ -112,7 +112,6 @@
     avifRGBImageSetDefaults(&rgb, avif);
     rgb.depth = imgBitDepth;
     avifRGBImageAllocatePixels(&rgb);
-    rowPointers = (png_bytep *)malloc(sizeof(png_bytep) * rgb.height);
     for (uint32_t y = 0; y < rgb.height; ++y) {
         rowPointers[y] = &rgb.pixels[y * rgb.rowBytes];
     }
@@ -127,9 +126,7 @@
     if (png) {
         png_destroy_read_struct(&png, &info, NULL);
     }
-    if (rowPointers) {
-        free(rowPointers);
-    }
+    free(rowPointers);
     avifRGBImageFreePixels(&rgb);
     return readResult;
 }
@@ -139,7 +136,7 @@
     avifBool writeResult = AVIF_FALSE;
     png_structp png = NULL;
     png_infop info = NULL;
-    png_bytep * rowPointers = NULL;
+    png_bytep * rowPointers = (png_bytep *)malloc(sizeof(png_bytep) * avif->height);
 
     avifRGBImage rgb;
     memset(&rgb, 0, sizeof(avifRGBImage));
@@ -192,7 +189,6 @@
     rgb.depth = rgbDepth;
     avifRGBImageAllocatePixels(&rgb);
     avifImageYUVToRGB(avif, &rgb);
-    rowPointers = (png_bytep *)malloc(sizeof(png_bytep) * rgb.height);
     for (uint32_t y = 0; y < rgb.height; ++y) {
         rowPointers[y] = &rgb.pixels[y * rgb.rowBytes];
     }
@@ -208,9 +204,7 @@
     if (png) {
         png_destroy_write_struct(&png, &info);
     }
-    if (rowPointers) {
-        free(rowPointers);
-    }
+    free(rowPointers);
     avifRGBImageFreePixels(&rgb);
     return writeResult;
 }