png loader fixes



Here is a patch which makes the png loader
survive

TEST_RANDOMLY_MODIFIED (valid_png_test, FALSE);

OK to commit ?

Index: io-png.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk-pixbuf/io-png.c,v
retrieving revision 1.40
diff -u -3 -p -u -r1.40 io-png.c
--- io-png.c	2001/07/18 04:25:03	1.40
+++ io-png.c	2001/08/29 10:16:12
@@ -563,6 +563,17 @@ png_row_callback   (png_structp png_read
         if (lc->fatal_error_occurred)
                 return;
 
+        if (row_num < 0 || row_num >= lc->pixbuf->width) {
+                lc->fatal_error_occurred = TRUE;
+                if (lc->error && *lc->error == NULL) {
+                        g_set_error (lc->error,
+                                     GDK_PIXBUF_ERROR,
+                                     GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+                                     _("Fatal error reading PNG image 
file"));
+                }
+                return;
+        }
+
         if (lc->first_row_seen_in_chunk < 0) {
                 lc->first_row_seen_in_chunk = row_num;
                 lc->first_pass_seen_in_chunk = pass_num;




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]