]> Dogcows Code - chaz/openbox/commitdiff
dont fux self in color_free if the color is NULL
authorDana Jansens <danakj@orodu.net>
Sun, 13 Apr 2003 02:26:56 +0000 (02:26 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 13 Apr 2003 02:26:56 +0000 (02:26 +0000)
render/color.c

index c25707205256a69e027dd8175e81a4a1c6d99248..939098ea4c5271d816e1ed54ac7151f39e6bda81 100644 (file)
@@ -58,9 +58,11 @@ color_rgb *color_new(int r, int g, int b)
 
 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 @@ void reduce_depth(pixel32 *data, XImage *im)
                 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++) {
This page took 0.022636 seconds and 4 git commands to generate.