diff options
author | Federico Mena Quintero <federico@gnome.org> | 2017-11-28 19:20:36 -0600 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gmail.com> | 2020-01-07 14:23:05 +0000 |
commit | ca8f5de301c8d4782c6b8908f7d1c2ba7d3b53bc (patch) | |
tree | b7488bb5b5ffd7ca7c808c86df5dedb1bb767a2f /gdk-pixbuf | |
parent | 0723e2727576219d074b9bbd05dba65565c3001e (diff) | |
download | gdk-pixbuf-ca8f5de301c8d4782c6b8908f7d1c2ba7d3b53bc.tar.gz |
ANI: assert and assume that the module callbacks are non-NULL
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/io-ani.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/gdk-pixbuf/io-ani.c b/gdk-pixbuf/io-ani.c index f08efa1c5..c6c4642cf 100644 --- a/gdk-pixbuf/io-ani.c +++ b/gdk-pixbuf/io-ani.c @@ -161,10 +161,9 @@ prepared_callback (GdkPixbufLoader *loader, if (context->pos == 0) { - if (context->prepared_func) - (* context->prepared_func) (pixbuf, - GDK_PIXBUF_ANIMATION (context->animation), - context->user_data); + (* context->prepared_func) (pixbuf, + GDK_PIXBUF_ANIMATION (context->animation), + context->user_data); } else { /* FIXME - this is necessary for nice display of loading @@ -189,10 +188,9 @@ updated_callback (GdkPixbufLoader* loader, GdkPixbuf *pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); - if (context->updated_func) - (* context->updated_func) (pixbuf, - x, y, width, height, - context->user_data); + (* context->updated_func) (pixbuf, + x, y, width, height, + context->user_data); } static gboolean @@ -586,6 +584,10 @@ gdk_pixbuf__ani_image_begin_load (GdkPixbufModuleSizeFunc size_func, { AniLoaderContext *context; + g_assert (size_func != NULL); + g_assert (prepared_func != NULL); + g_assert (updated_func != NULL); + context = g_new0 (AniLoaderContext, 1); context->prepared_func = prepared_func; |