diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2002-03-23 21:17:17 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2002-03-23 21:17:17 +0000 |
commit | 8bad93221106d81711a3dede829d5027a1c9e1f9 (patch) | |
tree | b2fe9335512d78090f5dc86266b977593eb374e1 | |
parent | ee8fd425f3a153c8b9e25801cc1194c1e0f8d5f4 (diff) | |
download | gdk-pixbuf-8bad93221106d81711a3dede829d5027a1c9e1f9.tar.gz |
context->updated_func is NULL during a nonincremental load.
* io-wbmp.c (gdk_pixbuf__wbmp_image_load_increment):
context->updated_func is NULL during a nonincremental load.
(gdk_pixbuf__wbmp_image_load): Stop reading after the first error.
-rw-r--r-- | gdk-pixbuf/ChangeLog | 6 | ||||
-rw-r--r-- | gdk-pixbuf/io-wbmp.c | 15 |
2 files changed, 14 insertions, 7 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 906369d94..8b1a0d6db 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,9 @@ +2002-03-23 Matthias Clasen <maclas@gmx.de> + + * io-wbmp.c (gdk_pixbuf__wbmp_image_load_increment): + context->updated_func is NULL during a nonincremental load. + (gdk_pixbuf__wbmp_image_load): Stop reading after the first error. + 2002-03-18 Matthias Clasen <maclas@gmx.de> * io-tga.c: Fix assumptions on rowstride by manually allocating a diff --git a/gdk-pixbuf/io-wbmp.c b/gdk-pixbuf/io-wbmp.c index 7bb8e1172..bfbfb4c36 100644 --- a/gdk-pixbuf/io-wbmp.c +++ b/gdk-pixbuf/io-wbmp.c @@ -93,11 +93,11 @@ static GdkPixbuf *gdk_pixbuf__wbmp_image_load(FILE * f, GError **error) while (feof(f) == 0) { length = fread(membuf, 1, 4096, f); - if (length > 0) - gdk_pixbuf__wbmp_image_load_increment(State, - membuf, - length, - error); + if (!gdk_pixbuf__wbmp_image_load_increment(State, membuf, length, + error)) { + gdk_pixbuf__wbmp_image_stop_load (State, NULL); + return NULL; + } } if (State->pixbuf != NULL) @@ -348,8 +348,9 @@ static gboolean gdk_pixbuf__wbmp_image_load_increment(gpointer data, context->needmore = FALSE; out: - context->updated_func(context->pixbuf, 0, first_row, context->width, context->cury - first_row + 1, - context->user_data); + if(context->updated_func) + context->updated_func(context->pixbuf, 0, first_row, context->width, context->cury - first_row + 1, + context->user_data); } else bv = FALSE; /* Nothing left to do, stop feeding me data! */ |