r11705 - in /desktop/unstable/gnome-session/debian: changelog patches/01_splash-memory-corruption.diff

joss at users.alioth.debian.org joss at users.alioth.debian.org
Wed Jun 27 19:39:31 UTC 2007


Author: joss
Date: Wed Jun 27 19:39:30 2007
New Revision: 11705

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=11705
Log:
* 01_splash-memory-corruption.diff: patch from upstream r4382,
  backported by Michel Dänzer. Fixes memory corruption with some
  icons (closes: #430630, #425742).

Added:
    desktop/unstable/gnome-session/debian/patches/01_splash-memory-corruption.diff
Modified:
    desktop/unstable/gnome-session/debian/changelog

Modified: desktop/unstable/gnome-session/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-session/debian/changelog?rev=11705&op=diff
==============================================================================
--- desktop/unstable/gnome-session/debian/changelog (original)
+++ desktop/unstable/gnome-session/debian/changelog Wed Jun 27 19:39:30 2007
@@ -1,10 +1,13 @@
-gnome-session (2.18.2-2) UNRELEASED; urgency=low
+gnome-session (2.18.2-2) unstable; urgency=low
 
   * default.session: remove gnome-volume-manager, it is now run through
     the autostart facility.
   * gnome-wm: add support for openbox (closes: #429729).
-
- -- Josselin Mouette <joss at debian.org>  Tue, 19 Jun 2007 21:20:57 +0200
+  * 01_splash-memory-corruption.diff: patch from upstream r4382,
+    backported by Michel Dänzer. Fixes memory corruption with some
+    icons (closes: #430630, #425742).
+
+ -- Josselin Mouette <joss at debian.org>  Wed, 27 Jun 2007 21:28:43 +0200
 
 gnome-session (2.18.2-1) unstable; urgency=low
 

Added: desktop/unstable/gnome-session/debian/patches/01_splash-memory-corruption.diff
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-session/debian/patches/01_splash-memory-corruption.diff?rev=11705&op=file
==============================================================================
--- desktop/unstable/gnome-session/debian/patches/01_splash-memory-corruption.diff (added)
+++ desktop/unstable/gnome-session/debian/patches/01_splash-memory-corruption.diff Wed Jun 27 19:39:30 2007
@@ -1,0 +1,104 @@
+Debian #430630, Bugzilla #446558
+GNOME Subversion: r4382, backported by Michel Dänzer.
+--- gnome-session-2.18.2.orig/gnome-session/splash-widget.c	2007-05-28 13:41:45.000000000 +0200
++++ gnome-session-2.18.2/gnome-session/splash-widget.c	2007-06-25 20:34:32.000000000 +0200
+@@ -74,13 +74,6 @@ typedef struct {
+ typedef struct {
+ 	SplashWidget *sw;
+ 	SplashIcon   *si;
+-	int width;
+-	int height;
+-	int n_channels;
+-	int rowstride_trans;
+-	int rowstride_orig;
+-	guchar *pixels_trans;
+-	guchar *pixels_orig;
+ } TransParam;
+ 
+ static gboolean
+@@ -485,6 +478,13 @@ layout_icon (SplashWidget *sw, SplashIco
+ 			si->scaled = gdk_pixbuf_scale_simple (
+ 				si->unscaled, sw->icon_size,
+ 				sw->icon_size, GDK_INTERP_BILINEAR);
++
++		if (!gdk_pixbuf_get_has_alpha (si->scaled)) {
++			si->scaled_copy = gdk_pixbuf_add_alpha (si->scaled, FALSE, 0, 0, 0);
++			g_object_unref (si->scaled);
++			si->scaled = gdk_pixbuf_copy (si->scaled_copy);
++		} else 
++			si->scaled_copy = gdk_pixbuf_copy (si->scaled);
+ 	}
+ 
+ 	if (sw->cur_x_offset >= (sw->image_bounds.width - SPLASH_ICON_BORDER * 2 -
+@@ -576,32 +576,19 @@ splash_widget_add_icon (SplashWidget *sw
+ 		si = g_new0 (SplashIcon, 1);
+ 		si->unscaled = pb;
+ 
++		layout_icon (sw, si, &area);
++
+ 		sw->icons = g_list_append (sw->icons, si);
+ 
+-		layout_icon (sw, si, &area);
+-	
+ 		/* prepare transparency effect */
+ 		if ((gdk_pixbuf_get_colorspace (si->scaled) == GDK_COLORSPACE_RGB) &&
+ 		    (gdk_pixbuf_get_bits_per_sample (si->scaled) == 8) &&
+ 		    (gdk_pixbuf_get_n_channels (si->scaled))) {
+ 			si->trans_count = 0;
+-			if (!gdk_pixbuf_get_has_alpha (si->scaled)) {
+-				si->scaled_copy = gdk_pixbuf_add_alpha (si->scaled, FALSE, 0, 0, 0);
+-				g_object_unref (si->scaled);
+-				si->scaled = gdk_pixbuf_copy (si->scaled_copy);
+-			} else 
+-				si->scaled_copy = gdk_pixbuf_copy (si->scaled);
+ 
+ 			tp = g_new0(TransParam, 1);
+ 			tp->si = si;
+ 			tp->sw = sw;
+-			tp->width  = gdk_pixbuf_get_width  (tp->si->scaled);
+-			tp->height = gdk_pixbuf_get_height (tp->si->scaled);
+-			tp->rowstride_trans = gdk_pixbuf_get_rowstride (tp->si->scaled);
+-			tp->rowstride_orig  = gdk_pixbuf_get_rowstride (tp->si->scaled_copy);
+-			tp->pixels_trans = gdk_pixbuf_get_pixels (tp->si->scaled);
+-			tp->pixels_orig  = gdk_pixbuf_get_pixels (tp->si->scaled_copy);
+-			tp->n_channels = gdk_pixbuf_get_n_channels (tp->si->scaled);
+ 
+ 			gdk_pixbuf_fill (si->scaled, 0x00000000);
+ 			g_timeout_add (TRANS_TIMEOUT, update_trans_effect, tp);
+@@ -624,6 +611,13 @@ update_trans_effect (gpointer trans_para
+ 	gdouble    r_mul, g_mul, b_mul, a_mul;
+ 	gint       x = 0;
+ 	gint	   y = 0;
++	gint	   width = 0;
++	gint	   height = 0;
++	int	   n_channels;
++	int	   rowstride_trans;
++	int	   rowstride_orig;
++	guchar	   *pixels_trans;
++	guchar	   *pixels_orig;
+ 
+ 	TransParam *tp = (TransParam *) trans_param;
+ 
+@@ -645,10 +639,18 @@ update_trans_effect (gpointer trans_para
+ 	g_mul = 1;
+ 	b_mul = 1;
+ 
+-	for (y = 0; y < tp->height; y++) {
+-		for (x = 0; x < tp->width; x++) {
+-			p_trans = tp->pixels_trans + y * tp->rowstride_trans + x * tp->n_channels;
+-			p_orig  = tp->pixels_orig  + y * tp->rowstride_orig  + x * tp->n_channels;
++	rowstride_trans = gdk_pixbuf_get_rowstride (tp->si->scaled);
++	rowstride_orig  = gdk_pixbuf_get_rowstride (tp->si->scaled_copy);
++	pixels_trans = gdk_pixbuf_get_pixels (tp->si->scaled);
++	pixels_orig  = gdk_pixbuf_get_pixels (tp->si->scaled_copy);
++	n_channels = gdk_pixbuf_get_n_channels (tp->si->scaled);
++	width  = gdk_pixbuf_get_width  (tp->si->scaled);
++	height = gdk_pixbuf_get_height (tp->si->scaled);
++
++	for (y = 0; y < height; y++) {
++		for (x = 0; x < width; x++) {
++			p_trans = pixels_trans + y * rowstride_trans + x * n_channels;
++			p_orig  = pixels_orig  + y * rowstride_orig  + x * n_channels;
+ 
+ 			/* we can add more effects here apart from alpha fading */
+ 			p_trans[0] = r_mul * p_orig[0];




More information about the pkg-gnome-commits mailing list