Add a bounds check when getting indexed items in dexlayout. am: 9a7f386ef0
am: 2744c76048

Change-Id: I1829e1f1409be95165b5b0b4af4f72c94cb254de