summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2017-11-29 06:59:00 -0600
committerEmmanuele Bassi <ebassi@gmail.com>2020-01-07 14:23:05 +0000
commit70f230b1ea57aaf1bce4d8c2d502fe46b4912a2a (patch)
treef62c3fe6bf43e47d3de18623957adefa88e5b861 /gdk-pixbuf
parente8fe9ff11c9c80cd874ceb21461e6e2fa34321bb (diff)
downloadgdk-pixbuf-70f230b1ea57aaf1bce4d8c2d502fe46b4912a2a.tar.gz
ICO: assert and assume that the module callbacks are non-NULL
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/io-ico.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/gdk-pixbuf/io-ico.c b/gdk-pixbuf/io-ico.c
index 8dca76ae4..5d4fa6592 100644
--- a/gdk-pixbuf/io-ico.c
+++ b/gdk-pixbuf/io-ico.c
@@ -510,7 +510,7 @@ static void DecodeHeader(guchar *Data, gint Bytes,
if (State->pixbuf == NULL) {
- if (State->size_func) {
+ {
gint width = State->Header.width;
gint height = State->Header.height;
@@ -540,12 +540,10 @@ static void DecodeHeader(guchar *Data, gint Bytes,
gdk_pixbuf_set_option (State->pixbuf, "y_hot", hot);
}
- if (State->prepared_func != NULL)
- /* Notify the client that we are ready to go */
- (*State->prepared_func) (State->pixbuf,
- NULL,
- State->user_data);
-
+ /* Notify the client that we are ready to go */
+ (*State->prepared_func) (State->pixbuf,
+ NULL,
+ State->user_data);
}
}
@@ -565,6 +563,10 @@ gdk_pixbuf__ico_image_begin_load(GdkPixbufModuleSizeFunc size_func,
{
struct ico_progressive_state *context;
+ g_assert (size_func != NULL);
+ g_assert (prepared_func != NULL);
+ g_assert (updated_func != NULL);
+
context = g_new0(struct ico_progressive_state, 1);
context->size_func = size_func;
context->prepared_func = prepared_func;
@@ -887,7 +889,7 @@ static void OneLine(struct ico_progressive_state *context)
context->LineWidth = (context->LineWidth / 4) * 4 + 4;
}
- if (context->updated_func != NULL) {
+ {
int y;
y = context->Lines % context->Header.height;