Blob Blame History Raw
diff --git a/plug-ins/common/file-svg.c b/plug-ins/common/file-svg.c
index 570b3632b18e7a663b6ef2b0110941f64123720e..9f3de881d187406fabbc913ee8543a8fee83dcc7 100644
--- a/plug-ins/common/file-svg.c
+++ b/plug-ins/common/file-svg.c
@@ -521,19 +521,24 @@ load_rsvg_size (const gchar  *filename,
           break;
         case G_IO_STATUS_EOF:
           success = rsvg_handle_close (handle, error);
-          break;
-        case G_IO_STATUS_NORMAL:
-          success = rsvg_handle_write (handle,
-                                       (const guchar *) buf, len, error);
-          rsvg_handle_get_dimensions (handle, &dim);
 
-          if (dim.width > 0 && dim.height > 0)
+          if (success)
             {
-              vals->width  = dim.width;
-              vals->height = dim.height;
+              rsvg_handle_get_dimensions (handle, &dim);
+
+              if (dim.width > 0 && dim.height > 0)
+                {
+                  vals->width  = dim.width;
+                  vals->height = dim.height;
 
-              done = TRUE;
+                  done = TRUE;
+                }
             }
+
+          break;
+        case G_IO_STATUS_NORMAL:
+          success = rsvg_handle_write (handle,
+                                       (const guchar *) buf, len, error);
           break;
         case G_IO_STATUS_AGAIN:
           break;