Skip to content
Commit c3fda89b authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

ImageDecoder: Use AssetFileDescriptor's length

Bug: 166069819
Test: ImageDecoderTest (cts)

The contained asset may only be a subset of the AssetFileDescriptor.
SkWebpCodec reads the entire stream into a contiguous block of memory.
(This is because libwebp does not provide a streaming API for creating
its demuxer.) If the AssetFileDescriptor contains data after the webp
file, this wastes memory. In some cases, there may be a *lot* of data
after the webp file, so this can use too much memory, particularly on
low memory devices.

Change-Id: I8d8e520f43a7ef0d7e4534ef165d8c7e4d2a0b55
parent 92d0655d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment