Commit 28508735 authored by Jerome Gaillard's avatar Jerome Gaillard
Browse files

nativeGetAllocationByteCount should return a positive int

Make sure Bitmap_Delegate.nativeGetAllocationByteCount always returns a
positive integer by returning Integer.MAX_VALUE if the the size of the
picture overflows the int. That is to prevent an exception coming from
passing a negative value to NativeAllocationRegistry.
The result is only passed to NativeAllocationRegistry that registers at
most Integer.MAX_VALUE, so that has no impact in layoutlib.

Test: layoutlib tests
Change-Id: I1e637a92df161c341a6ba07cbbe98bac6ec96fcd
parent 180f8978
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment