Do not try to pass possibly negative values to malloc() calls that do not expect them. Change-Id: I20933983c26287cde5769e1594060b5a04eb09f6 Warned-by: coverity