summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2017-11-28 19:22:08 -0600
committerEmmanuele Bassi <ebassi@gmail.com>2020-01-07 14:23:05 +0000
commit0d89b4ea0a636df4a1be7cbc40fa947e86488ff3 (patch)
tree99bb3c1dbb17d2a2978f686ca94ab08f2eef46bd /gdk-pixbuf
parentca8f5de301c8d4782c6b8908f7d1c2ba7d3b53bc (diff)
downloadgdk-pixbuf-0d89b4ea0a636df4a1be7cbc40fa947e86488ff3.tar.gz
TIFF: assert and assume that the module callbacks are non-NULL
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/io-tiff.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gdk-pixbuf/io-tiff.c b/gdk-pixbuf/io-tiff.c
index 8d9780583..79c23d4cc 100644
--- a/gdk-pixbuf/io-tiff.c
+++ b/gdk-pixbuf/io-tiff.c
@@ -153,7 +153,7 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
bytes = height * rowstride;
- if (context && context->size_func) {
+ if (context) {
gint w = width;
gint h = height;
(* context->size_func) (&w, &h, context->user_data);
@@ -276,7 +276,7 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
}
}
- if (context && context->prepare_func)
+ if (context)
(* context->prepare_func) (pixbuf, NULL, context->user_data);
if (!TIFFReadRGBAImageOriented (tiff, width, height, (uint32 *)pixels, ORIENTATION_TOPLEFT, 1)) {
@@ -316,7 +316,7 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
}
#endif
- if (context && context->update_func)
+ if (context)
(* context->update_func) (pixbuf, 0, 0, width, height, context->user_data);
return pixbuf;
@@ -398,6 +398,10 @@ gdk_pixbuf__tiff_image_begin_load (GdkPixbufModuleSizeFunc size_func,
{
TiffContext *context;
+ g_assert (size_func != NULL);
+ g_assert (prepare_func != NULL);
+ g_assert (update_func != NULL);
+
context = g_new0 (TiffContext, 1);
context->size_func = size_func;
context->prepare_func = prepare_func;