PR #24371 opened by vytskalt
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24371
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24371.patch

It seems like some braces were forgotten here. If the `if` case fails, then err 
is 0 (not `AVERROR(ENOTSUP)`) and `switch_layout` is skipped, returning 0 
(success)


>From aed06937da236198a752bf9d615f664c1da1b14e Mon Sep 17 00:00:00 2001
From: vytskalt <[email protected]>
Date: Sat, 5 Sep 2026 00:55:46 +0300
Subject: [PATCH] hwcontext_vulkan: fix possible skip of switch_layout in
 prepare_frame

---
 libavutil/hwcontext_vulkan.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 2e0e526041..877e29966c 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -2691,11 +2691,11 @@ static int prepare_frame(AVHWFramesContext *hwfc, 
FFVkExecPool *ectx,
     AVVulkanFramesContext *hwfc_vk = hwfc->hwctx;
     if (hwfc_vk->usage & VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT &&
         (pmode != PREP_MODE_EXTERNAL_EXPORT) &&
-        (pmode != PREP_MODE_EXTERNAL_IMPORT))
+        (pmode != PREP_MODE_EXTERNAL_IMPORT)) {
         err = switch_layout_host(hwfc, ectx, frame, pmode);
-
-    if (err != AVERROR(ENOTSUP))
-        return err;
+        if (err != AVERROR(ENOTSUP))
+            return err;
+    }
 
     return switch_layout(hwfc, ectx, frame, pmode);
 }
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to