Fix allocation size for ImageData (the header is 6, not 4 bytes long)
This commit is contained in:
parent
af0c0a4082
commit
845bf4838c
1 changed files with 1 additions and 1 deletions
|
@ -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…
Reference in a new issue