[gtk+] icontheme: Avoid a crash
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] icontheme: Avoid a crash
- Date: Sat, 30 Jan 2016 05:29:33 +0000 (UTC)
commit e54549502e3b0b1bd8b01fc7de9c44a339e4437c
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jan 29 23:36:24 2016 -0500
icontheme: Avoid a crash
gtk_icon_info_new_for_file with a size of 0 would fail for
symbolic pngs because we ended up scaling with 0. Avoid this.
gtk/gtkicontheme.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 0a04258..d7dc371 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -3949,7 +3949,7 @@ icon_info_ensure_scale_and_pixbuf (GtkIconInfo *icon_info)
icon_info->scale = image_size / 1000.;
else if (icon_info->scale < 0.0)
{
- if (image_size > 0)
+ if (image_size > 0 && scaled_desired_size > 0)
icon_info->scale = (gdouble)scaled_desired_size / (gdouble)image_size;
else
icon_info->scale = 1.0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]