all repos — mgba @ 67bc8e73a33a968b16d9dd319edbe5ac8e13cc46

mGBA Game Boy Advance Emulator

Util: Fix excessive memory allocation when decoding a PNG
Jeffrey Pfau jeffrey@endrift.com
Tue, 29 Dec 2015 16:58:30 -0500
commit

67bc8e73a33a968b16d9dd319edbe5ac8e13cc46

parent

71ef6666d0bc95c7048832ed4b7519051b49d40a

2 files changed, 2 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.csrc/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; }