aboutsummaryrefslogtreecommitdiff
path: root/nxcompext/Pgn.c
diff options
context:
space:
mode:
Diffstat (limited to 'nxcompext/Pgn.c')
-rw-r--r--nxcompext/Pgn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/nxcompext/Pgn.c b/nxcompext/Pgn.c
index db14f51e3..d8fa919cc 100644
--- a/nxcompext/Pgn.c
+++ b/nxcompext/Pgn.c
@@ -548,13 +548,14 @@ char *PngCompressData(XImage *image, int *compressed_size)
}
png_write_end(png_ptr, NULL);
- png_destroy_write_struct(&png_ptr, &info_ptr);
if (color_type == PNG_COLOR_TYPE_PALETTE)
{
png_free(png_ptr, palette);
}
+ png_destroy_write_struct(&png_ptr, &info_ptr);
+
/*
* Check the size of the resulting data.
*/