BMP are read on the stack to avoid a malloc. Lua memory displayed when
pressing [Menu Long]
This commit is contained in:
+1
-5
@@ -36,7 +36,7 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
const pm_char * bmpLoad(bmp_ptr_t &bmp, const char *filename, const xcoord_t width, const uint8_t height)
|
||||
const pm_char * bmpLoad(uint8_t *bmp, const char *filename, const xcoord_t width, const uint8_t height)
|
||||
{
|
||||
FIL bmpFile;
|
||||
UINT read;
|
||||
@@ -147,10 +147,6 @@ const pm_char * bmpLoad(bmp_ptr_t &bmp, const char *filename, const xcoord_t wid
|
||||
}
|
||||
}
|
||||
|
||||
if (bmp == NULL) {
|
||||
bmp = (uint8_t *)malloc(2+w*((h+7)/8)*4);
|
||||
}
|
||||
|
||||
uint8_t *dest = bmp;
|
||||
|
||||
*dest++ = w;
|
||||
|
||||
Reference in New Issue
Block a user