--- ./librsvg-2.9.5/rsvg-shapes.c	2005/03/03 01:45:29	1.1
+++ ./librsvg-2.9.5/rsvg-shapes.c	2005/03/03 01:45:51
@@ -1538,12 +1538,17 @@ rsvg_acquire_file_resource (const char *
 	
 	while (!feof (f)) {
 		length = fread (buffer, 1, sizeof (buffer), f);
-		if (length > 0)
+		if (length > 0) {
 			if (g_byte_array_append (array, buffer, length) == NULL) {
 				fclose (f);
 				g_byte_array_free (array, TRUE);
 				return NULL;
 			}
+		} else if (ferror (f)) {
+			fclose (f);
+			g_byte_array_free (array, TRUE);
+			return NULL;
+		}
 	}
 	
 	fclose (f);
