[x265] [PATCH] Fix issue with left-over filename not being treated as input parameter

Kirithika Kalirathnam kirithika at multicorewareinc.com
Fri Sep 27 09:00:02 UTC 2024


Please ignore the previous patch and find the updated patch attached.
>From 89161b8e14b11ad595de610704b70c0a3ccd81c0 Mon Sep 17 00:00:00 2001
From: Kirithika <kirithika at multicorewareinc.com>
Date: Wed, 18 Sep 2024 14:52:12 +0530
Subject: [PATCH] Fix issue with left-over filename not being treated as
input
 parameter

---
 source/x265cli.cpp | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/source/x265cli.cpp b/source/x265cli.cpp
index ca7d9c973..ba0b620b7 100755
--- a/source/x265cli.cpp
+++ b/source/x265cli.cpp
@@ -598,6 +598,7 @@ namespace X265_NS {
         for (int view = 0; view < MAX_VIEWS; view++)
         {
             inputfn[view] = X265_MALLOC(char, sizeof(char) * 1024);
+            memset(inputfn[view], 0, sizeof(char) * 1024);
         }
         const char* reconfn[MAX_LAYERS] = { NULL };
         const char *outputfn = NULL;
@@ -805,10 +806,11 @@ namespace X265_NS {
             }
         }

-#if !ENABLE_MULTIVIEW
-        if (optind < argc && !inputfn[0])
-            inputfn[0] = argv[optind++];
-#endif
+        if (param->numViews < 2)
+        {
+            if (optind < argc && !(*inputfn[0]))
+                strcpy(inputfn[0], argv[optind++]);
+        }
         if (optind < argc && !outputfn)
             outputfn = argv[optind++];
         if (optind < argc)
-- 
2.28.0.windows.1

*Thanks,*
*Kirithika*


On Fri, Sep 27, 2024 at 10:12 AM Kirithika Kalirathnam <
kirithika at multicorewareinc.com> wrote:

> From 9bdaa0ace80a25523e6e66a4c792c4d81b7249a2 Mon Sep 17 00:00:00 2001
> From: Kirithika <kirithika at multicorewareinc.com>
> Date: Wed, 18 Sep 2024 14:52:12 +0530
> Subject: [PATCH] Fix issue with left-over filename not being treated as
> input
>  parameter
>
> ---
>  source/x265cli.cpp | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/source/x265cli.cpp b/source/x265cli.cpp
> index ca7d9c973..26f15d5c6 100755
> --- a/source/x265cli.cpp
> +++ b/source/x265cli.cpp
> @@ -598,6 +598,7 @@ namespace X265_NS {
>          for (int view = 0; view < MAX_VIEWS; view++)
>          {
>              inputfn[view] = X265_MALLOC(char, sizeof(char) * 1024);
> +            memset(inputfn[view], 0, sizeof(char) * 1024);
>          }
>          const char* reconfn[MAX_LAYERS] = { NULL };
>          const char *outputfn = NULL;
> @@ -806,8 +807,8 @@ namespace X265_NS {
>          }
>
>  #if !ENABLE_MULTIVIEW
> -        if (optind < argc && !inputfn[0])
> -            inputfn[0] = argv[optind++];
> +        if (optind < argc && !(*inputfn[0]))
> +            strcpy(inputfn[0], argv[optind++]);
>  #endif
>          if (optind < argc && !outputfn)
>              outputfn = argv[optind++];
> --
> 2.28.0.windows.1
>
> *Thanks,*
> *Kirithika*
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20240927/b469aef5/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-input-parameter-patch2.diff
Type: application/octet-stream
Size: 1287 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20240927/b469aef5/attachment.obj>


More information about the x265-devel mailing list