fix a potential overflow with MALLOC_LIMIT BUG=webp:321 Change-Id: Iab89dfe167fb394fcdffd3b2732d4ac9bef764b0