Merge "Centralize bounds checking and don't overflow"
am: fc9b8b8f0d

Change-Id: Ic88310fd7400f9853b4e10ff6ba0cd00a101e808