Fix security vulnerability: Effect command might allow negative indexes
am: 01183402d7

Change-Id: I13603ac1cdb57b844ca7d03f119adda832825f34