diff options
author | Federico Mena Quintero <federico@gnome.org> | 2017-11-29 06:56:53 -0600 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gmail.com> | 2020-01-07 14:23:05 +0000 |
commit | 61188355401795e10f9a47e12519af1a87b82bcc (patch) | |
tree | 9d262c9b60c44653e08c8660edce86440c4d3e14 | |
parent | fdb803e309b96f446e993bc9484f5a237cd23263 (diff) | |
download | gdk-pixbuf-61188355401795e10f9a47e12519af1a87b82bcc.tar.gz |
XPM: assert and assume that the module callbacks are non-NULL
-rw-r--r-- | gdk-pixbuf/io-xpm.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/gdk-pixbuf/io-xpm.c b/gdk-pixbuf/io-xpm.c index 7fc588715..2b8cf7445 100644 --- a/gdk-pixbuf/io-xpm.c +++ b/gdk-pixbuf/io-xpm.c @@ -723,6 +723,10 @@ gdk_pixbuf__xpm_image_begin_load (GdkPixbufModuleSizeFunc size_func, XPMContext *context; gint fd; + g_assert (size_func != NULL); + g_assert (prepare_func != NULL); + g_assert (update_func != NULL); + context = g_new (XPMContext, 1); context->prepare_func = prepare_func; context->update_func = update_func; @@ -761,16 +765,14 @@ gdk_pixbuf__xpm_image_stop_load (gpointer data, pixbuf = gdk_pixbuf__xpm_image_load (context->file, error); if (pixbuf != NULL) { - if (context->prepare_func) - (* context->prepare_func) (pixbuf, - NULL, - context->user_data); - if (context->update_func) - (* context->update_func) (pixbuf, - 0, 0, - gdk_pixbuf_get_width (pixbuf), - gdk_pixbuf_get_height (pixbuf), - context->user_data); + (* context->prepare_func) (pixbuf, + NULL, + context->user_data); + (* context->update_func) (pixbuf, + 0, 0, + gdk_pixbuf_get_width (pixbuf), + gdk_pixbuf_get_height (pixbuf), + context->user_data); g_object_unref (pixbuf); retval = TRUE; |