From 1b5224e95a98ea02255641cec8a9f1a781c56ec9 Mon Sep 17 00:00:00 2001 From: NightlyFox Date: Sat, 29 Sep 2018 14:46:08 -0500 Subject: [PATCH] recycling malloc so imageptr would not be null, imageptr is ovewerwritten by tjDecompress2 inner malloc so copy is made --- common/menu-entry.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/menu-entry.c b/common/menu-entry.c index 57b6d5c..c8f3800 100644 --- a/common/menu-entry.c +++ b/common/menu-entry.c @@ -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;