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

This commit is contained in:
Michal Moskal 2015-11-17 15:57:19 -08:00
parent af0c0a4082
commit 845bf4838c
1 changed files with 1 additions and 1 deletions

View File

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