summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2021-09-17 02:29:59 +0200
committerBenjamin Otte <otte@redhat.com>2021-09-17 02:29:59 +0200
commit4fcf54757f2da7f899fd7d7728666f40c4aeecfa (patch)
tree9c71cb42998ed52d2d8f3df6b7b717cbe2ff95e5
parentb5da07f0e1a61be22d8290c871670633f77c6e7b (diff)
downloadgtk+-4fcf54757f2da7f899fd7d7728666f40c4aeecfa.tar.gz
icontheme: Insist that people provide proper values
Seriously...
-rw-r--r--gtk/gtkicontheme.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index a48dfb433d..94f1dc4730 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -4095,14 +4095,6 @@ gtk_icon_paintable_new_for_pixbuf (GtkIconTheme *icon_theme,
int scale)
{
GtkIconPaintable *icon;
- int width, height;
-
- if (size <= 0)
- {
- width = gdk_pixbuf_get_width (pixbuf);
- height = gdk_pixbuf_get_height (pixbuf);
- size = MAX (width, height);
- }
icon = icon_paintable_new (NULL, size, scale);
icon->texture = gdk_texture_new_for_pixbuf (pixbuf);
@@ -4139,6 +4131,8 @@ gtk_icon_theme_lookup_by_gicon (GtkIconTheme *self,
g_return_val_if_fail (GTK_IS_ICON_THEME (self), NULL);
g_return_val_if_fail (G_IS_ICON (gicon), NULL);
+ g_return_val_if_fail (size > 0, NULL);
+ g_return_val_if_fail (scale > 0, NULL);
/* We can't render emblemed icons atm, but at least render the base */
while (G_IS_EMBLEMED_ICON (gicon))