summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/VulkanManager.h
diff options
context:
space:
mode:
authorRoman Kiryanov <rkir@google.com>2019-03-07 18:22:19 -0800
committerRoman Kiryanov <rkir@google.com>2019-03-11 16:07:20 -0700
commit74ace839e01801ee01cf841bf27762947a70d8b1 (patch)
treebafd99335b7196f9892b2c4b1f368f56d94e2065 /libs/hwui/renderthread/VulkanManager.h
parent6c1d1c32e3aefc0414eda1fdf1af7edf9ef6100a (diff)
Copy extension names to an owning container to prevent use-after-free
Bug: 127660235 Test: make -j Change-Id: I3748b7b4b51f99acf59748675223cef02c22bee2 Signed-off-by: Roman Kiryanov <rkir@google.com>
Diffstat (limited to 'libs/hwui/renderthread/VulkanManager.h')
-rw-r--r--libs/hwui/renderthread/VulkanManager.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/VulkanManager.h b/libs/hwui/renderthread/VulkanManager.h
index 95c9630fb728..f5518e50f17e 100644
--- a/libs/hwui/renderthread/VulkanManager.h
+++ b/libs/hwui/renderthread/VulkanManager.h
@@ -148,6 +148,8 @@ public:
status_t createReleaseFence(sp<Fence>& nativeFence);
// Returned pointers are owned by VulkanManager.
+ // An instance of VkFunctorInitParams returned from getVkFunctorInitParams refers to
+ // the internal state of VulkanManager: VulkanManager must be alive to use the returned value.
VkFunctorInitParams getVkFunctorInitParams() const;
sk_sp<GrContext> createContext(const GrContextOptions& options);
@@ -249,7 +251,9 @@ private:
// Variables saved to populate VkFunctorInitParams.
static const uint32_t mAPIVersion = VK_MAKE_VERSION(1, 1, 0);
+ std::vector<VkExtensionProperties> mInstanceExtensionsOwner;
std::vector<const char*> mInstanceExtensions;
+ std::vector<VkExtensionProperties> mDeviceExtensionsOwner;
std::vector<const char*> mDeviceExtensions;
VkPhysicalDeviceFeatures2 mPhysicalDeviceFeatures2{};