gdk: Add some return_if_fail() warnings

so we have a better chance of catching the correct cause of bugs like

https://bugzilla.gnome.org/show_bug.cgi?id=719977
This commit is contained in:
Benjamin Otte 2013-12-06 19:21:27 +01:00
parent 860138b302
commit 0bff206915

View File

@ -284,6 +284,10 @@ gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf,
cairo_format_t format;
cairo_surface_t *surface;
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
g_return_val_if_fail (scale > 0, NULL);
g_return_val_if_fail (for_window == NULL || GDK_IS_WINDOW (for_window), NULL);
if (gdk_pixbuf_get_n_channels (pixbuf) == 3)
format = CAIRO_FORMAT_RGB24;
else