summaryrefslogtreecommitdiff
path: root/src/gd_png.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gd_png.c')
-rw-r--r--src/gd_png.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gd_png.c b/src/gd_png.c
index a325e5c..4d8d49f 100644
--- a/src/gd_png.c
+++ b/src/gd_png.c
@@ -1079,11 +1079,12 @@ static int _gdImagePngCtxEx(gdImagePtr im, gdIOCtx * outfile, int level)
}
png_write_image (png_ptr, row_pointers);
- png_write_end (png_ptr, info_ptr);
for (j = 0; j < height; ++j)
gdFree (row_pointers[j]);
gdFree (row_pointers);
+
+ png_write_end (png_ptr, info_ptr);
} else {
png_write_image (png_ptr, im->pixels);
png_write_end (png_ptr, info_ptr);