Util: Fix excessive memory allocation when decoding a PNG
Jeffrey Pfau jeffrey@endrift.com
Tue, 29 Dec 2015 16:58:30 -0500
2 files changed,
2 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -19,6 +19,7 @@ - ARM7: Fix sign of unaligned LDRSH
- 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
M
src/util/png-io.c
→
src/util/png-io.c
@@ -52,7 +52,7 @@ return info;
} 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; }