Index: gdk-pixbuf/io-png.c
===================================================================
--- gdk-pixbuf/io-png.c	(Revision 19938)
+++ gdk-pixbuf/io-png.c	(Arbeitskopie)
@@ -391,6 +391,8 @@ struct _LoadContext {
         gint max_row_seen_in_chunk;
         
         guint fatal_error_occurred : 1;
+        /* This is set TRUE if the loader finished */
+        guint finished_loading : 1;
 
         GError **error;
 };
@@ -407,6 +409,7 @@ gdk_pixbuf__png_image_begin_load (GdkPix
         lc = g_new0(LoadContext, 1);
         
         lc->fatal_error_occurred = FALSE;
+        lc->finished_loading = FALSE;
 
         lc->size_func = size_func;
         lc->prepare_func = prepare_func;
@@ -480,6 +483,7 @@ static gboolean
 gdk_pixbuf__png_image_stop_load (gpointer context, GError **error)
 {
         LoadContext* lc = context;
+        gboolean retval = TRUE;
 
         g_return_val_if_fail(lc != NULL, TRUE);
 
@@ -489,11 +493,20 @@ gdk_pixbuf__png_image_stop_load (gpointe
         
         if (lc->pixbuf)
                 g_object_unref (lc->pixbuf);
+
+        if (!lc->finished_loading) {
+                if (error && *error == NULL) {
+                        g_set_error (error, GDK_PIXBUF_ERROR,
+                                     GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+                                     _("Premature end-of-file encountered"));
+                }
+                retval = FALSE;
+        }
         
         png_destroy_read_struct(&lc->png_read_ptr, &lc->png_info_ptr, NULL);
         g_free(lc);
 
-        return TRUE;
+        return retval;
 }
 
 static gboolean
@@ -711,6 +724,8 @@ png_end_callback   (png_structp png_read
 
         if (lc->fatal_error_occurred)
                 return;
+
+        lc->finished_loading = TRUE;
 }
 
 static void
