Index: nautilus-3.21.91/src/nautilus-canvas-container.c
===================================================================
--- nautilus-3.21.91.orig/src/nautilus-canvas-container.c
+++ nautilus-3.21.91/src/nautilus-canvas-container.c
@@ -2039,7 +2039,8 @@ lay_down_icons_vertical_desktop (Nautilu
                 }
 
                 /* Check and see if we need to move to a new column */
-                if (y != DESKTOP_PAD_VERTICAL && y + icon_height_for_bound_check > height)
+                if (y != DESKTOP_PAD_VERTICAL && y + icon_height_for_bound_check > height &&
+                    height > 0 && total > 3)
                 {
                     break;
                 }
@@ -2087,7 +2088,7 @@ lay_down_icons_vertical_desktop (Nautilu
                 /* Check and see if we need to move to a new column */
                 if (y != DESKTOP_PAD_VERTICAL && y > height - icon_height_for_bound_check &&
                     /* Make sure we lay out at least one icon per column, to make progress */
-                    p != icons)
+                    p != icons && height > 0 && total > 3)
                 {
                     x += column_width + DESKTOP_PAD_HORIZONTAL;
                     break;
