This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit f2f6cdfd794dfdd0d3c3b46affcd0617039e2e6a
Author:     Niklas Haas <[email protected]>
AuthorDate: Tue Oct 20 12:01:41 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Tue Oct 20 19:50:40 2026 +0000

    swscale/vulkan/ops: handle errors in process()
    
    Failures from ff_vk_create_imageviews_fmt() and friends were ignored,
    leading to descriptors being updated with uninitialized image views.
    Discard the execution and bail out instead. SwsPassFunc has no way to
    return errors, so just log them for now.
    
    Signed-off-by: Niklas Haas <[email protected]>
---
 libswscale/vulkan/ops.c | 44 ++++++++++++++++++++++++++++++++------------
 1 file changed, 32 insertions(+), 12 deletions(-)

diff --git a/libswscale/vulkan/ops.c b/libswscale/vulkan/ops.c
index 18aa671ed5..3720faeef7 100644
--- a/libswscale/vulkan/ops.c
+++ b/libswscale/vulkan/ops.c
@@ -98,23 +98,33 @@ static void process(const SwsFrame *dst, const SwsFrame 
*src, int y, int h,
     VulkanPriv *p = (VulkanPriv *) pass->priv;
     FFVkExecContext *ec = ff_vk_exec_get(&p->s->vkctx, &p->e);
     FFVulkanFunctions *vk = &p->s->vkctx.vkfn;
-    ff_vk_exec_start(&p->s->vkctx, ec);
+    int err = ff_vk_exec_start(&p->s->vkctx, ec);
+    if (err < 0)
+        goto error;
 
     AVFrame *src_f = (AVFrame *) src->avframe;
     AVFrame *dst_f = (AVFrame *) dst->avframe;
-    ff_vk_exec_add_dep_frame(&p->s->vkctx, ec, src_f,
-                             VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT,
-                             VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT);
-    ff_vk_exec_add_dep_frame(&p->s->vkctx, ec, dst_f,
-                             VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT,
-                             VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT);
+    err = ff_vk_exec_add_dep_frame(&p->s->vkctx, ec, src_f,
+                                   VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT,
+                                   VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT);
+    if (err < 0)
+        goto fail;
+    err = ff_vk_exec_add_dep_frame(&p->s->vkctx, ec, dst_f,
+                                   VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT,
+                                   VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT);
+    if (err < 0)
+        goto fail;
 
     VkImageView src_views[AV_NUM_DATA_POINTERS];
     VkImageView dst_views[AV_NUM_DATA_POINTERS];
-    ff_vk_create_imageviews_fmt(&p->s->vkctx, ec, src_views, src_f,
-                                p->src_view_fmt);
-    ff_vk_create_imageviews_fmt(&p->s->vkctx, ec, dst_views, dst_f,
-                                p->dst_view_fmt);
+    err = ff_vk_create_imageviews_fmt(&p->s->vkctx, ec, src_views, src_f,
+                                      p->src_view_fmt);
+    if (err < 0)
+        goto fail;
+    err = ff_vk_create_imageviews_fmt(&p->s->vkctx, ec, dst_views, dst_f,
+                                      p->dst_view_fmt);
+    if (err < 0)
+        goto fail;
 
     ff_vk_shader_update_img_array(&p->s->vkctx, ec, &p->shd, src_f, src_views,
                                   0, 0, VK_IMAGE_LAYOUT_GENERAL, 
VK_NULL_HANDLE);
@@ -155,8 +165,18 @@ static void process(const SwsFrame *dst, const SwsFrame 
*src, int y, int h,
                     FFALIGN(dst->height, p->shd.lg_size[1])/p->shd.lg_size[1],
                     1);
 
-    ff_vk_exec_submit(&p->s->vkctx, ec);
+    err = ff_vk_exec_submit(&p->s->vkctx, ec);
+    if (err < 0)
+        goto error;
     ff_vk_exec_wait(&p->s->vkctx, ec);
+    return;
+
+fail:
+    ff_vk_exec_discard(&p->s->vkctx, ec);
+error:
+    /* SwsPassFunc has no way to return errors */
+    av_log(&p->s->vkctx, AV_LOG_ERROR, "Vulkan pass failed: %s\n",
+           av_err2str(err));
 }
 
 static void free_fn(void *priv)

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to