summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2014-04-14 18:43:12 -0700
committerColin Cross <ccross@android.com>2014-04-14 19:06:47 -0700
commit288f2ef6294b99a4a53355273ae8ad0f5a525f65 (patch)
tree3a808962a1f096af29a1052e9c973298e3d398b7 /libs
parent27f8840f228abfe5e2458a261ce5403871495a54 (diff)
downloadframeworks_native-288f2ef6294b99a4a53355273ae8ad0f5a525f65.zip
frameworks_native-288f2ef6294b99a4a53355273ae8ad0f5a525f65.tar.gz
frameworks_native-288f2ef6294b99a4a53355273ae8ad0f5a525f65.tar.bz2
libui: fix passing Fence object over binder
The Fence object was writing a size_t into the binder buffer in flatten, which changes size if the producer and consumer are running in a 32-bit and a 64-bit process. Use a uint32_t instead. Change-Id: Ifed526513800ce27f9d605101cddd922292cca37
Diffstat (limited to 'libs')
-rw-r--r--libs/ui/Fence.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/ui/Fence.cpp b/libs/ui/Fence.cpp
index 93ec0ce..3c0306c 100644
--- a/libs/ui/Fence.cpp
+++ b/libs/ui/Fence.cpp
@@ -138,7 +138,7 @@ status_t Fence::flatten(void*& buffer, size_t& size, int*& fds, size_t& count) c
if (size < getFlattenedSize() || count < getFdCount()) {
return NO_MEMORY;
}
- FlattenableUtils::write(buffer, size, getFdCount());
+ FlattenableUtils::write(buffer, size, (uint32_t)getFdCount());
if (isValid()) {
*fds++ = mFenceFd;
count--;
@@ -156,7 +156,7 @@ status_t Fence::unflatten(void const*& buffer, size_t& size, int const*& fds, si
return NO_MEMORY;
}
- size_t numFds;
+ uint32_t numFds;
FlattenableUtils::read(buffer, size, numFds);
if (numFds > 1) {