Util: Fix excessive memory allocation when decoding a PNG

This commit is contained in:
Jeffrey Pfau 2015-12-29 16:58:30 -05:00
parent 71ef6666d0
commit 67bc8e73a3
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -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;
}