Fix allocation size for ImageData (the header is 6, not 4 bytes long)

master
Michal Moskal 7 years ago
parent af0c0a4082
commit 845bf4838c

@ -249,7 +249,7 @@ void MicroBitImage::init(const int16_t x, const int16_t y, const uint8_t *bitmap
// Create a copy of the array
ptr = (ImageData*)malloc(4 + x * y);
ptr = (ImageData*)malloc(sizeof(ImageData) + x * y);
ptr->init();
ptr->width = x;
ptr->height = y;

Loading…
Cancel
Save