This is to avoid out-of-range memory access. BUG=aomedia:391 Change-Id: I211ba1992d4f51fcf06cf2961d8cb2606b836207