Bug 557059 – crash when compositing emblems with icon
2008-10-20 Christian Persch <chpe@gnome.org> Bug 557059 – crash when compositing emblems with icon * gtk/gtkicontheme.c: (apply_emblems): Copy the pixbuf before using it with gtk_pixbuf_composite, in case its pixdata is read-only (mmaped from icon cache or builtins). svn path=/trunk/; revision=21690
This commit is contained in:
committed by
Christian Persch
parent
093d425393
commit
4ba6262be9
@ -1,3 +1,11 @@
|
|||||||
|
2008-10-20 Christian Persch <chpe@gnome.org>
|
||||||
|
|
||||||
|
Bug 557059 – crash when compositing emblems with icon
|
||||||
|
|
||||||
|
* gtk/gtkicontheme.c: (apply_emblems): Copy the pixbuf before using it
|
||||||
|
with gtk_pixbuf_composite, in case its pixdata is read-only (mmaped
|
||||||
|
from icon cache or builtins).
|
||||||
|
|
||||||
2008-10-20 Murray Cumming <murrayc@murrayc.com>
|
2008-10-20 Murray Cumming <murrayc@murrayc.com>
|
||||||
|
|
||||||
* gtk/gtkiconview.c: gtk_icon_view_set_tooltip_row(),
|
* gtk/gtkiconview.c: gtk_icon_view_set_tooltip_row(),
|
||||||
|
|||||||
@ -2776,13 +2776,15 @@ static gboolean icon_info_ensure_scale_and_pixbuf (GtkIconInfo*, gboolean);
|
|||||||
static void
|
static void
|
||||||
apply_emblems (GtkIconInfo *info)
|
apply_emblems (GtkIconInfo *info)
|
||||||
{
|
{
|
||||||
GdkPixbuf *icon;
|
GdkPixbuf *icon = NULL;
|
||||||
gint w, h, pos;
|
gint w, h, pos;
|
||||||
GSList *l;
|
GSList *l;
|
||||||
|
|
||||||
icon = info->pixbuf;
|
if (info->emblem_infos == NULL)
|
||||||
w = gdk_pixbuf_get_width (icon);
|
return;
|
||||||
h = gdk_pixbuf_get_height (icon);
|
|
||||||
|
w = gdk_pixbuf_get_width (info->pixbuf);
|
||||||
|
h = gdk_pixbuf_get_height (info->pixbuf);
|
||||||
|
|
||||||
for (l = info->emblem_infos, pos = 0; l; l = l->next, pos++)
|
for (l = info->emblem_infos, pos = 0; l; l = l->next, pos++)
|
||||||
{
|
{
|
||||||
@ -2826,10 +2828,23 @@ apply_emblems (GtkIconInfo *info)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (icon == NULL)
|
||||||
|
{
|
||||||
|
icon = gdk_pixbuf_copy (info->pixbuf);
|
||||||
|
if (icon == NULL)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
gdk_pixbuf_composite (emblem, icon, x, y, ew, eh, x, y,
|
gdk_pixbuf_composite (emblem, icon, x, y, ew, eh, x, y,
|
||||||
scale, scale, GDK_INTERP_BILINEAR, 255);
|
scale, scale, GDK_INTERP_BILINEAR, 255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (icon)
|
||||||
|
{
|
||||||
|
g_object_unref (info->pixbuf);
|
||||||
|
info->pixbuf = icon;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function contains the complicated logic for deciding
|
/* This function contains the complicated logic for deciding
|
||||||
|
|||||||
Reference in New Issue
Block a user