mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 02:58:05 +02:00
panvk: avoid dereferencing a null-pointer
If we're passed a memory-info, but no memory-prop, we'd end up dereferencing a null-pointer here. Let's use a fallback struct instead, similar to what RADV does. Fixes:d970fe2e9d("panfrost: Add a Vulkan driver for Midgard/Bifrost GPUs") CID: 1496060 Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28856> (cherry picked from commit3b3df7b8a9)
This commit is contained in:
parent
06995f634f
commit
cf443b52c7
2 changed files with 8 additions and 1 deletions
|
|
@ -934,7 +934,7 @@
|
|||
"description": "panvk: avoid dereferencing a null-pointer",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "d970fe2e9d6a8e9997a0ce212146d62013b3b455",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1250,6 +1250,13 @@ panvk_GetPhysicalDeviceImageFormatProperties2(
|
|||
* present and VkExternalImageFormatProperties will be ignored.
|
||||
*/
|
||||
if (external_info && external_info->handleType != 0) {
|
||||
VkExternalImageFormatProperties fallback_external_props;
|
||||
|
||||
if (!external_props) {
|
||||
memset(&fallback_external_props, 0, sizeof(fallback_external_props));
|
||||
external_props = &fallback_external_props;
|
||||
}
|
||||
|
||||
result = panvk_get_external_image_format_properties(
|
||||
physical_device, base_info, external_info->handleType,
|
||||
&external_props->externalMemoryProperties);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue