From: Seungha Yang Date: Thu, 3 Jun 2021 16:44:47 +0000 (+0900) Subject: vkinstance: Don't abort in case that system has no available vulkan device X-Git-Tag: 1.19.3~507^2~334 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d0f136297e79a84989670f65af37f9327fd26aa;p=platform%2Fupstream%2Fgstreamer.git vkinstance: Don't abort in case that system has no available vulkan device Specification doesn't have restriction that returned pPhysicalDeviceCount value must be non-zero Part-of: --- diff --git a/gst-libs/gst/vulkan/gstvkinstance.c b/gst-libs/gst/vulkan/gstvkinstance.c index 14db329..46f9148 100644 --- a/gst-libs/gst/vulkan/gstvkinstance.c +++ b/gst-libs/gst/vulkan/gstvkinstance.c @@ -975,7 +975,15 @@ gst_vulkan_instance_open (GstVulkanInstance * instance, GError ** error) if (gst_vulkan_error_to_g_error (err, error, "vkEnumeratePhysicalDevices") < 0) goto error; - g_assert (instance->n_physical_devices > 0); + + if (instance->n_physical_devices == 0) { + GST_WARNING_OBJECT (instance, "No available physical device"); + g_set_error_literal (error, + GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_NOT_FOUND, + "No available physical device"); + goto error; + } + instance->physical_devices = g_new0 (VkPhysicalDevice, instance->n_physical_devices); err =