--- ./librsvg-2.9.5/rsvg-shapes.c	2005/03/03 01:00:46	1.1
+++ ./librsvg-2.9.5/rsvg-shapes.c	2005/03/03 01:00:51
@@ -1544,6 +1544,11 @@ rsvg_acquire_file_resource (const char *
 				g_byte_array_free (array, TRUE);
 				return NULL;
 			}
+		else if (length < 0) {
+			fclose (f);
+			g_byte_array_free (array, TRUE);
+			return NULL;
+		}
 	}
 	
 	fclose (f);
