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.
This commit is contained in:
Matthias Clasen 2016-01-29 23:36:24 -05:00
parent 2e4b1e72f4
commit e54549502e

View File

@ -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;