[compiz] Some quick fixes for decorators

Mike Dransfield mike at blueroot.co.uk
Thu Dec 28 08:18:31 PST 2006


Here are some quick patches which I have pulled from
heliodor, sonce gwd and heliodor are the same I think
these apply too (they look good to me anyway :))

Here are the original changes

http://bugs.beryl-project.org/trac/changeset/2118

I have attached a different patch for each since I dont
think they are actually related.


-------------- next part --------------
>From 4215b9b6d04bf3b55b9e35daf742f9eef96af7ec Mon Sep 17 00:00:00 2001
From: Mike Dransfield <mike at localhost.(none)>
Date: Thu, 28 Dec 2006 16:16:38 +0000
Subject: [PATCH] Fix slight possible memory leak in libdecoration

---
 libdecoration/decoration.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libdecoration/decoration.c b/libdecoration/decoration.c
index 91486e7..ee76d93 100644
--- a/libdecoration/decoration.c
+++ b/libdecoration/decoration.c
@@ -877,7 +877,10 @@ create_gaussian_kernel (double radius,
 
     params = malloc (sizeof (XFixed) * n);
     if (!params)
+    {
+    	free(amp);
 	return NULL;
+    }
 
     i   = 0;
     sum = 0.0f;
-- 
1.4.4.3

-------------- next part --------------
>From 1c655d95b5262e971dd411769f0c7f7e31624cc7 Mon Sep 17 00:00:00 2001
From: Mike Dransfield <mike at localhost.(none)>
Date: Thu, 28 Dec 2006 16:17:57 +0000
Subject: [PATCH] Small buffer overrun in gtk-window-decorator

---
 gtk/window-decorator/gtk-window-decorator.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gtk/window-decorator/gtk-window-decorator.c b/gtk/window-decorator/gtk-window-decorator.c
index 17ace9c..e408fc0 100644
--- a/gtk/window-decorator/gtk-window-decorator.c
+++ b/gtk/window-decorator/gtk-window-decorator.c
@@ -247,7 +247,7 @@ static decor_context_t shadow_context = {
 
 static gdouble shadow_radius   = SHADOW_RADIUS;
 static gdouble shadow_opacity  = SHADOW_OPACITY;
-static gint    shadow_color[3] = {
+static gushort    shadow_color[3] = {
     SHADOW_COLOR_RED,
     SHADOW_COLOR_GREEN,
     SHADOW_COLOR_BLUE
-- 
1.4.4.3



More information about the compiz mailing list