summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2017-11-28 19:22:58 -0600
committerEmmanuele Bassi <ebassi@gmail.com>2020-01-07 14:23:05 +0000
commit6f986ba6ccb6a9bb17f18eddc99b613e12c4a31a (patch)
tree20ede36473869a9c6f7ff30893816d5e64ac446c /gdk-pixbuf
parent0d89b4ea0a636df4a1be7cbc40fa947e86488ff3 (diff)
downloadgdk-pixbuf-6f986ba6ccb6a9bb17f18eddc99b613e12c4a31a.tar.gz
XBM: assert and assume that the module callbacks are non-NULL
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/io-xbm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdk-pixbuf/io-xbm.c b/gdk-pixbuf/io-xbm.c
index e6fa4c019..20fbfadc9 100644
--- a/gdk-pixbuf/io-xbm.c
+++ b/gdk-pixbuf/io-xbm.c
@@ -342,7 +342,7 @@ gdk_pixbuf__xbm_image_load_real (FILE *f,
pixels = gdk_pixbuf_get_pixels (pixbuf);
row_stride = gdk_pixbuf_get_rowstride (pixbuf);
- if (context && context->prepare_func)
+ if (context)
(* context->prepare_func) (pixbuf, NULL, context->user_data);
@@ -371,8 +371,7 @@ gdk_pixbuf__xbm_image_load_real (FILE *f,
g_free (data);
if (context) {
- if (context->update_func)
- (* context->update_func) (pixbuf, 0, 0, w, h, context->user_data);
+ (* context->update_func) (pixbuf, 0, 0, w, h, context->user_data);
}
return pixbuf;
@@ -406,6 +405,10 @@ gdk_pixbuf__xbm_image_begin_load (GdkPixbufModuleSizeFunc size_func,
XBMData *context;
gint fd;
+ g_assert (size_func != NULL);
+ g_assert (prepare_func != NULL);
+ g_assert (update_func != NULL);
+
context = g_new (XBMData, 1);
context->prepare_func = prepare_func;
context->update_func = update_func;