`gtk_icon_helper_paintable_get_current_image` is broken?
gtk_icon_helper_paintable_get_current_image
calls itself on self->paintable
, recursively. Therefore, the only way to exit this call is if self->paintable == NULL
. Which means, it never returns an image.
static GdkPaintable *
gtk_icon_helper_paintable_get_current_image (GdkPaintable *paintable)
{
GtkIconHelper *self = GTK_ICON_HELPER (paintable);
gtk_icon_helper_ensure_paintable (self, FALSE);
if (self->paintable == NULL)
return NULL;
return gtk_icon_helper_paintable_get_current_image (self->paintable);
}
Additionally, self->paintable
is either a GdkPaintable
supplied directly by the user, or a GtkIconPaintable
, neither of which are derived from GtkIconHelper
, so the second call is going to pick out random memory, and possibly crash.
Apparently, this is fine, because only GtkCellRendererPixbuf
and GtkImage
use GtkIconHelper
, and they only call gdk_paintable_snapshot
on it. And since it's otherwise private, there's probably no other way to trigger it. So it looks odd, but is probably benign.