BMP are read on the stack to avoid a malloc. Lua memory displayed when

pressing [Menu Long]
This commit is contained in:
bsongis
2014-05-30 16:14:54 +02:00
parent 687ddd8f4d
commit 950f651af9
4 changed files with 30 additions and 23 deletions
+1 -5
View File
@@ -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;