mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 09:41:07 +00:00
vulkan: Replace open-coded precondition checks with g_return_val_if_fail
While analyzing gst_vulkan_get_or_create_image_view_with_info() it seems obvious that this function returns NULL, and that this should be covered in the return annotations. However, closer inspection indicates that this is only a precondition check when the incoming arguments are incompatible with each other, and should not be considered as a function that optionally returns a pointer. Signify this by using precondition checks instead of an opencoded if-return-NULL. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5736>
This commit is contained in:
parent
10464f352f
commit
006ac293bc
1 changed files with 4 additions and 3 deletions
|
@ -493,9 +493,10 @@ gst_vulkan_get_or_create_image_view_with_info (GstVulkanImageMemory * image,
|
|||
fill_vulkan_image_view_info (image->image, image->create_info.format,
|
||||
&_create_info);
|
||||
create_info = &_create_info;
|
||||
} else if (!(create_info->format == image->create_info.format
|
||||
&& create_info->image == image->image)) {
|
||||
return NULL;
|
||||
} else {
|
||||
g_return_val_if_fail (create_info->format == image->create_info.format,
|
||||
NULL);
|
||||
g_return_val_if_fail (create_info->image == image->image, NULL);
|
||||
}
|
||||
|
||||
ret = gst_vulkan_image_memory_find_view (image,
|
||||
|
|
Loading…
Reference in a new issue