summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_formats.c
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2017-05-02 22:06:01 -0700
committerLionel Landwerlin <[email protected]>2017-05-08 14:38:27 +0100
commit6247b8b41321087a8931becc812819a76fcaebbb (patch)
tree91aca738fa3b09895fa53741b763511b62f509b0 /src/intel/vulkan/anv_formats.c
parentdc795f85a56ee95f16ef33c7cf6b373506c9b0d6 (diff)
anv: avoid null pointer dereference
The application might not give an output structure. CID: 1405765 (Null pointer dereferences) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_formats.c')
-rw-r--r--src/intel/vulkan/anv_formats.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index 4c930eda1dd..c39cec3800a 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -715,7 +715,8 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties2KHR(
if (external_info && external_info->handleType != 0) {
switch (external_info->handleType) {
case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHX:
- external_props->externalMemoryProperties = prime_fd_props;
+ if (external_props)
+ external_props->externalMemoryProperties = prime_fd_props;
break;
default:
/* From the Vulkan 1.0.42 spec: