[x265] [PATCH] Fix issue with left-over filename not being treated as input parameter
Andrey Semashev
andrey.semashev at gmail.com
Fri Sep 27 08:00:37 UTC 2024
On September 27, 2024 7:42:48 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++]);
strcpy is a buffer overrun waiting to happen.
> #endif
> if (optind < argc && !outputfn)
> outputfn = argv[optind++];
> --
> 2.28.0.windows.1
>
> *Thanks,*
> *Kirithika*
>
>
>
> ----------
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
More information about the x265-devel
mailing list