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

Change-Id: Ie18aa07bc89d619e84dc4b9717fb96b6d93f4928