[FFmpeg-devel] [PATCH 10/10] fftools/ffplay: Check vulkan_params

Michael Niedermayer michael at niedermayer.cc
Sun Apr 28 02:54:24 EEST 2024


Fixes: CID1550133 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 fftools/ffplay.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index 63a9806fb80..cc00e209d52 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -3839,8 +3839,13 @@ int main(int argc, char **argv)
         if (vk_renderer) {
             AVDictionary *dict = NULL;
 
-            if (vulkan_params)
-                av_dict_parse_string(&dict, vulkan_params, "=", ":", 0);
+            if (vulkan_params) {
+                int ret = av_dict_parse_string(&dict, vulkan_params, "=", ":", 0);
+                if (ret < 0) {
+                    av_log(NULL, AV_LOG_FATAL, "Failed to parse, %s\n", vulkan_params);
+                    do_exit(NULL);
+                }
+            }
             ret = vk_renderer_create(vk_renderer, window, dict);
             av_dict_free(&dict);
             if (ret < 0) {
-- 
2.43.2



More information about the ffmpeg-devel mailing list