dont fux self in color_free if the color is NULL
Dana Jansens danakj@orodu.net
1 files changed,
6 insertions(+),
4 deletions(-)
jump to
M
render/color.c
→
render/color.c
@@ -58,9 +58,11 @@ /*XXX same color could be pointed to twice, this might have to be a refcount*/
void color_free(color_rgb *c) { - if (c->gc != None) - XFreeGC(ob_display, c->gc); - g_free(c); + if (c != NULL) { + if (c->gc != None) + XFreeGC(ob_display, c->gc); + g_free(c); + } } void reduce_depth(pixel32 *data, XImage *im)@@ -87,7 +89,7 @@ }
data += im->width; p32 += im->width; } - } else im->data = data; + } else im->data = (char*) data; break; case 16: for (y = 0; y < im->height; y++) {