Skip to content

Commit 934f729

Browse files
Fang Huijreck
authored andcommitted
Use ANDROID_NATIVE_UNSIGNED_CAST() in GraphicBufferMapper::lockAsync()
If bit 31 of the return value of android_convertGralloc1To0Usage() is 1, the high 32 bits of "usage" is all 1. To fix, add ANDROID_NATIVE_UNSIGNED_CAST(). Change-Id: I501c5dd66ee3f3a25269b5eb6e5d74c05cf44c79 Merged-In: Ib4590b7a3b839a993f6c747c5f09a6312f7ab329 Signed-off-by: Fang Hui <hui.fang@nxp.com>
1 parent 951e735 commit 934f729

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

libs/ui/GraphicBufferMapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ status_t GraphicBufferMapper::lockAsync(buffer_handle_t handle, uint64_t produce
171171
int32_t* outBytesPerStride) {
172172
ATRACE_CALL();
173173

174-
const uint64_t usage = static_cast<uint64_t>(
175-
android_convertGralloc1To0Usage(producerUsage, consumerUsage));
174+
const uint64_t usage = static_cast<uint64_t>(ANDROID_NATIVE_UNSIGNED_CAST(
175+
android_convertGralloc1To0Usage(producerUsage, consumerUsage)));
176176
return mMapper->lock(handle, usage, bounds, fenceFd, vaddr, outBytesPerPixel,
177177
outBytesPerStride);
178178
}

0 commit comments

Comments
 (0)