From 6f986ba6ccb6a9bb17f18eddc99b613e12c4a31a Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Tue, 28 Nov 2017 19:22:58 -0600 Subject: XBM: assert and assume that the module callbacks are non-NULL --- gdk-pixbuf/io-xbm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gdk-pixbuf') 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; -- cgit v1.2.1