From 5e2646e70f22ea9399fc321111556e316b6f6900 Mon Sep 17 00:00:00 2001 From: Johannes Winkelmann Date: Wed, 31 Aug 2005 23:18:54 +0000 Subject: [PATCH] - fix illegal memory access when using graphs wider than 256px - increase max graph width to 512 git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@257 7f574dfc-610e-0410-a909-a81674777703 --- src/conky.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conky.c b/src/conky.c index 11bc5aa9..b6008095 100644 --- a/src/conky.c +++ b/src/conky.c @@ -385,7 +385,7 @@ static int special_count; static int special_index; /* used when drawing */ #endif /* X11 */ -#define MAX_GRAPH_DEPTH 256 /* why 256? who knows. */ +#define MAX_GRAPH_DEPTH 512 /* why 512? who knows. */ static struct special_t *new_special(char *buf, int t) { @@ -552,7 +552,7 @@ static unsigned int adjust_colors(unsigned int color) static void new_graph(char *buf, int w, int h, unsigned int first_colour, unsigned int second_colour, double i, int scale, int append) { struct special_t *s = new_special(buf, GRAPH); - s->width = w; + s->width = (w < MAX_GRAPH_DEPTH) ? w : MAX_GRAPH_DEPTH; s->height = h; s->first_colour = adjust_colors(first_colour); s->last_colour = adjust_colors(second_colour);