Merge "Fixing issue where ItemInfo had errant cell coordinates leading to an array-out-of-bounds exception. (Bug 6333784)"
diff --git a/src/com/android/launcher2/InstallShortcutReceiver.java b/src/com/android/launcher2/InstallShortcutReceiver.java
index 82fb3d1..eda82e0 100644
--- a/src/com/android/launcher2/InstallShortcutReceiver.java
+++ b/src/com/android/launcher2/InstallShortcutReceiver.java
@@ -174,8 +174,8 @@
                     cellY = item.cellY;
                     spanX = item.spanX;
                     spanY = item.spanY;
-                    for (int x = cellX; x < cellX + spanX && x < xCount; x++) {
-                        for (int y = cellY; y < cellY + spanY && y < yCount; y++) {
+                    for (int x = cellX; 0 <= x && x < cellX + spanX && x < xCount; x++) {
+                        for (int y = cellY; 0 <= y && y < cellY + spanY && y < yCount; y++) {
                             occupied[x][y] = true;
                         }
                     }