summaryrefslogtreecommitdiffstats
path: root/modules/gralloc
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-08-08 17:01:18 -0700
committerMathias Agopian <mathias@google.com>2009-08-08 17:01:18 -0700
commited04f7871bab3cb07e47e42fe4d9ebe5b02281a2 (patch)
tree2b4456786d46e9e6bc6fcf37e53751678c261834 /modules/gralloc
parent7d512e3dc37cc921a3e0e541a0476a4168310ecc (diff)
downloadhardware_libhardware-ed04f7871bab3cb07e47e42fe4d9ebe5b02281a2.zip
hardware_libhardware-ed04f7871bab3cb07e47e42fe4d9ebe5b02281a2.tar.gz
hardware_libhardware-ed04f7871bab3cb07e47e42fe4d9ebe5b02281a2.tar.bz2
don't memset ashmem region, especially before they're mmapped
Diffstat (limited to 'modules/gralloc')
-rw-r--r--modules/gralloc/gralloc.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gralloc/gralloc.cpp b/modules/gralloc/gralloc.cpp
index d936cd3..404d8b8 100644
--- a/modules/gralloc/gralloc.cpp
+++ b/modules/gralloc/gralloc.cpp
@@ -300,6 +300,7 @@ try_ashmem:
fd = -1;
}
//LOGD_IF(!err, "allocating pmem size=%d, offset=%d", size, offset);
+ memset((char*)base + offset, 0, size);
}
} else {
if ((usage & GRALLOC_USAGE_HW_2D) == 0) {
@@ -329,7 +330,6 @@ try_ashmem:
hnd->base = int(base)+offset;
hnd->lockState = lockState;
*pHandle = hnd;
- memset((void*)hnd->base, 0, size);
}
LOGE_IF(err, "gralloc failed err=%s", strerror(-err));