recycling malloc so imageptr would not be null, imageptr is ovewerwritten by tjDecompress2 inner malloc so copy is made

This commit is contained in:
NightlyFox 2018-09-29 14:46:08 -05:00
parent 7a959263de
commit 1b5224e95a

View File

@ -323,7 +323,8 @@ bool menuEntryLoad(menuEntry_s* me, const char* name, bool shortcut) {
void menuEntryParseIcon(menuEntry_s* me) {
size_t imagesize = 256*256*3;
unsigned char imageptr[imagesize];
unsigned char *imageptr = (unsigned char*)malloc(imagesize);//imageptr cannot be null
me->icon_gfx = (uint8_t*)imageptr;
int w,h,samp;
if (me->icon_size==0 || me->icon==NULL) return;