]> Pileus Git - ~andy/gtk/commitdiff
context->updated_func is NULL during a nonincremental load.
authorMatthias Clasen <matthiasc@src.gnome.org>
Sat, 23 Mar 2002 21:17:17 +0000 (21:17 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sat, 23 Mar 2002 21:17:17 +0000 (21:17 +0000)
* 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.

gdk-pixbuf/ChangeLog
gdk-pixbuf/io-wbmp.c

index 906369d948a878cf63aa0cb8d86bc012eec6b6fe..8b1a0d6dbc80226892b791f7c3201a1667820793 100644 (file)
@@ -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
index 7bb8e117220036990ada8b537a0a1ef4f8c8848a..bfbfb4c36eb4ac8c5b067f9a649fb43898fad01e 100644 (file)
@@ -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! */