Exit early if ensureCapacity is unable to allocate the required capacity

ensureCapacity used to return -1 when the allocation failed for the
requested capacity. The callers weren't checking for the return value and continued using the buffer assuming the request was successful. Since there is no way to recover from this error just exit early in ensureCapacity.

Bug: 261385338
Change-Id: I75f4503ae42e6f03f8cfebb1fd3c8ee6c873c5b6
1 file changed
tree: 73eb518861d418afcea38b8da874b549da1c8034
  1. dexgen/
  2. docs/
  3. dx/
  4. opcode-gen/
  5. tools/
  6. Android.bp
  7. CleanSpec.mk
  8. NOTICE
  9. OWNERS