summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorraylinhsu <raylinhsu@google.com>2020-04-22 00:35:30 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-04-22 00:35:30 +0000
commita41745960839a1bb480f5470f966ebda3b2996da (patch)
treed9f960f877d310a8c8d3b3f11b238d8e893ffeae
parenta4e956afc8e995eabaca904f861713c5e0ad07d9 (diff)
parent36c8e106e55405d1487577fc135e297ad3160ab4 (diff)
downloadplatform_hardware_qcom_sdm845_display-a41745960839a1bb480f5470f966ebda3b2996da.tar.gz
platform_hardware_qcom_sdm845_display-a41745960839a1bb480f5470f966ebda3b2996da.tar.bz2
platform_hardware_qcom_sdm845_display-a41745960839a1bb480f5470f966ebda3b2996da.zip
gralloc: Additional buffer validation in getTransportSize am: 9c248775d3 am: 3e405a0778 am: 36c8e106e5
Change-Id: I7a32000ede56bb8a7c7f3776d67b9c4726cb59e6
-rw-r--r--gralloc/QtiMapper.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/gralloc/QtiMapper.cpp b/gralloc/QtiMapper.cpp
index 80655361..ee1d36f0 100644
--- a/gralloc/QtiMapper.cpp
+++ b/gralloc/QtiMapper.cpp
@@ -245,13 +245,15 @@ Return<void> QtiMapper::getTransportSize(void *buffer,
auto err = Error::BAD_BUFFER;
auto hnd = static_cast<private_handle_t *>(buffer);
uint32_t num_fds = 0, num_ints = 0;
- if (buffer != nullptr && private_handle_t::validate(hnd) == 0) {
+ if (buffer != nullptr && private_handle_t::validate(hnd) == 0 &&
+ buf_mgr_->IsBufferImported(hnd) == Error::NONE) {
num_fds = 2;
// TODO(user): reduce to transported values;
num_ints = static_cast<uint32_t >(hnd->numInts);
err = Error::NONE;
}
- ALOGD_IF(DEBUG, "GetTransportSize: num fds: %d num ints: %d err:%d", num_fds, num_ints, err);
+ ALOGD_IF(DEBUG, "GetTransportSize: num fds: %d num ints: %d IsBufferImported:%d err:%d",
+ num_fds, num_ints, buf_mgr_->IsBufferImported(hnd), err);
hidl_cb(err, num_fds, num_ints);
return Void();
}