From 075bf06c715b5f198916360350f06acd88e9be90 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Fri, 19 Aug 2011 21:19:06 +0800 Subject: [PATCH 1/2] Fix crash in prerender_save when STKM is near bottom of save --- src/graphics.c | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/src/graphics.c b/src/graphics.c index 696cab9eb..907838658 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -4441,35 +4441,29 @@ pixel *prerender_save(void *save, int size, int *width, int *height) j=d[p++]; if (j0) { - if (j==PT_STKM) + if (j==PT_STKM || j==PT_STKM2) { - //Stickman drawing - for (k=-2; k<=1; k++) + pixel lc, hc=PIXRGB(255, 224, 178); + if (j==PT_STKM) lc = PIXRGB(255, 255, 255); + else lc = PIXRGB(100, 100, 255); + //only need to check upper bound of y coord - lower bounds and x Date: Fri, 19 Aug 2011 22:00:48 +0800 Subject: [PATCH 2/2] Memory leaks and uninitialised value in catalogue_ui --- src/interface.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/interface.c b/src/interface.c index 3a5662c7d..939699b37 100644 --- a/src/interface.c +++ b/src/interface.c @@ -5470,7 +5470,7 @@ void catalogue_ui(pixel * vid_buf) int listy = 0, listxc; int listx = 0, listyc; pixel * vid_buf2; - float scrollvel, offsetf = 0.0f; + float scrollvel = 0.0f, offsetf = 0.0f; char savetext[128] = ""; char * last = mystrdup(""); savelist_e *saves, *cssave, *csave; @@ -5687,6 +5687,8 @@ openfin: if(saves) free_saveslist(saves); + free(last); + free(vid_buf2); return; }