don't memset ashmem region, especially before they're mmapped
This commit is contained in:
@@ -300,6 +300,7 @@ try_ashmem:
|
|||||||
fd = -1;
|
fd = -1;
|
||||||
}
|
}
|
||||||
//LOGD_IF(!err, "allocating pmem size=%d, offset=%d", size, offset);
|
//LOGD_IF(!err, "allocating pmem size=%d, offset=%d", size, offset);
|
||||||
|
memset((char*)base + offset, 0, size);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((usage & GRALLOC_USAGE_HW_2D) == 0) {
|
if ((usage & GRALLOC_USAGE_HW_2D) == 0) {
|
||||||
@@ -329,7 +330,6 @@ try_ashmem:
|
|||||||
hnd->base = int(base)+offset;
|
hnd->base = int(base)+offset;
|
||||||
hnd->lockState = lockState;
|
hnd->lockState = lockState;
|
||||||
*pHandle = hnd;
|
*pHandle = hnd;
|
||||||
memset((void*)hnd->base, 0, size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGE_IF(err, "gralloc failed err=%s", strerror(-err));
|
LOGE_IF(err, "gralloc failed err=%s", strerror(-err));
|
||||||
|
|||||||
Reference in New Issue
Block a user