diff options
author | Sarita Rawat <sarita.rawat@samsung.com> | 2015-09-11 12:02:00 +0000 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2016-12-19 19:10:38 +0100 |
commit | afb4f77c1e11a392dd310a2689e130c46dceb69e (patch) | |
tree | 278cff3c089b0aea6d508119a8a1f264144e928f | |
parent | 5916326b0427d8df50c5e1b0a2cc592de017935f (diff) | |
download | gdk-pixbuf-afb4f77c1e11a392dd310a2689e130c46dceb69e.tar.gz |
gdk-pixbuf: Add NULL guards to some utility functions
https://bugzilla.gnome.org/show_bug.cgi?id=754878
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-scale.c | 2 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-util.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf-scale.c b/gdk-pixbuf/gdk-pixbuf-scale.c index 475126aae..945e3a4d3 100644 --- a/gdk-pixbuf/gdk-pixbuf-scale.c +++ b/gdk-pixbuf/gdk-pixbuf-scale.c @@ -422,6 +422,7 @@ gdk_pixbuf_rotate_simple (const GdkPixbuf *src, guchar *q; gint x, y; + g_return_val_if_fail (GDK_IS_PIXBUF (src), NULL); src_pixels = gdk_pixbuf_read_pixels (src); switch (angle % 360) @@ -526,6 +527,7 @@ gdk_pixbuf_flip (const GdkPixbuf *src, guchar *q; gint x, y; + g_return_val_if_fail (GDK_IS_PIXBUF (src), NULL); dest = gdk_pixbuf_new (src->colorspace, src->has_alpha, src->bits_per_sample, diff --git a/gdk-pixbuf/gdk-pixbuf-util.c b/gdk-pixbuf/gdk-pixbuf-util.c index 3600450e9..db1562b76 100644 --- a/gdk-pixbuf/gdk-pixbuf-util.c +++ b/gdk-pixbuf/gdk-pixbuf-util.c @@ -282,7 +282,8 @@ gdk_pixbuf_saturate_and_pixelate(const GdkPixbuf *src, * appropriate transform will be performed so that the pixbuf * is oriented correctly. * - * Return value: (transfer full): A newly-created pixbuf, or a reference to the + * Return value: (transfer full): A newly-created pixbuf, %NULL if + * not enough memory could be allocated for it, or a reference to the * input pixbuf (with an increased reference count). * * Since: 2.12 |