Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

Decode file descriptor from the correct offset.

Fix a few bugs in nativeDecodeFileDescriptor:
1. Restore the FD's offset when exiting the function.
2. Copy the data when potentially using an SkImageRef.
   The old behavior would have continued to modify the
   file descriptor's offset each time a new decode was
   required. The copy ensures that the file descriptor
   remains unchanged.
3. Buffer the file stream.
   Prior to this change, if the image was not a PNG,
   the stream would be rewound to the beginning of the
   file, even if the file descriptor was passed in with
   an offset. Thanks to the buffer, the stream is only
   rewound to the original offset.

Depends on https://googleplex-android-review.googlesource.com/#/c/415821/1
in external/skia

BUG:12807677
BUG:12895876
Change-Id: I38b8cf5d210dbbc0107e6562e3884867de57fc4b
parent 2ac4f3b2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment