summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaldev Sahu <bsahu@codeaurora.org>2019-08-02 11:15:47 -0400
committerGerrit - the friendly Code Review server <code-review@localhost>2020-03-09 02:52:36 -0700
commitdd19513f7b2ff5e3707b439c763d27f3ec515e3c (patch)
treee391bd3075e5078628ae96a321a7000494867b1f
parentd2b712c7db0d97294efb89d7a0f76dc9a4f42edf (diff)
gralloc: Additional buffer validation in getTransportSize
CRs-Fixed: 2502270 Change-Id: Ia578dc97ea7280c8df11dc10e1a119e6be1b87df
-rw-r--r--gralloc/QtiMapper.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/gralloc/QtiMapper.cpp b/gralloc/QtiMapper.cpp
index f0401432..c9790c26 100644
--- a/gralloc/QtiMapper.cpp
+++ b/gralloc/QtiMapper.cpp
@@ -246,6 +246,10 @@ Return<void> QtiMapper::getTransportSize(void *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 (buf_mgr_->IsBufferImported(hnd) != Error::NONE) {
+ hidl_cb(err, num_fds, num_ints);
+ return Void();
+ }
num_fds = 2;
// TODO(user): reduce to transported values;
num_ints = static_cast<uint32_t >(hnd->numInts);