Fix possible out of bounds access Bug: 28868315 Change-Id: I2b416c662f9ad7f9b3c6cf973a39c6693c66775a (cherry picked from commit 751b4eba25aa2e2a31232c9c25ceb6dbddfb1d93)