mirror of
https://github.com/mpv-player/mpv
synced 2025-03-25 04:38:01 +00:00
vulkan: don't assume all ra_ctx implementations have a swapchain
The dmabuf-wayland vo has a stub ra implementation that doesn't have a swapchain. That means that it's currently not safe to call ra_vk_ctx_get on that ra_ctx, but it must be safe to call on all ra implementations as this is how we discover if it is a vulkan ra. This hasn't been an issue before because no Vulkan code paths would be triggered when using dmabuf-wayland, but with the new vulkan hwdec, it becomes possible to trigger when hwdecs are probed.
This commit is contained in:
parent
c8790a9173
commit
ba6af0fb15
@ -121,7 +121,7 @@ static const struct ra_swapchain_fns vulkan_swapchain;
|
||||
|
||||
struct mpvk_ctx *ra_vk_ctx_get(struct ra_ctx *ctx)
|
||||
{
|
||||
if (ctx->swapchain->fns != &vulkan_swapchain)
|
||||
if (!ctx->swapchain || ctx->swapchain->fns != &vulkan_swapchain)
|
||||
return NULL;
|
||||
|
||||
struct priv *p = ctx->swapchain->priv;
|
||||
|
Loading…
Reference in New Issue
Block a user