Fix miscalculating large memory allocations.
am: 68a632d493

Change-Id: I0bd679f9b42051e5c5a223b333835eeb1e5776f9