diff options
-rw-r--r-- | src/PNG.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/PNG.cpp b/src/PNG.cpp index 6f83fc5..9edf88c 100644 --- a/src/PNG.cpp +++ b/src/PNG.cpp @@ -139,7 +139,7 @@ static void readScaled(uint8_t *data, size_t offset_w, size_t offset_h, const ch } void mipmap(const char *output, size_t width, size_t height, bool colored, const char *nw, const char *ne, const char *sw, const char *se) { - uint8_t data[4*width*height]; + uint8_t data[(colored ? 4 : 2)*width*height]; std::memset(data, 0, sizeof(data)); readScaled(data, 0, 0, nw, width, height, colored); |