diff --git a/CHANGES b/CHANGES index 8b4f8542a..73891e951 100644 --- a/CHANGES +++ b/CHANGES @@ -19,6 +19,7 @@ Bugfixes: - GBA: Fix warnings when creating and loading savestates - GBA Memory: Fix DMAs triggering two cycles early - GBA Hardware: Fix GPIO on big endian + - Util: Fix excessive memory allocation when decoding a PNG Misc: - Qt: Window size command line options are now supported - Qt: Increase usability of key mapper diff --git a/src/util/png-io.c b/src/util/png-io.c index 1e171d57d..cb9e90fdf 100644 --- a/src/util/png-io.c +++ b/src/util/png-io.c @@ -52,7 +52,7 @@ png_infop PNGWriteHeader(png_structp png, unsigned width, unsigned height) { } bool PNGWritePixels(png_structp png, unsigned width, unsigned height, unsigned stride, const void* pixels) { - png_bytep row = malloc(sizeof(png_bytep) * width * 3); + png_bytep row = malloc(sizeof(png_byte) * width * 3); if (!row) { return false; }