>From f909f75116a00761253dab5a52fd6b50215ec5da Mon Sep 17 00:00:00 2001
From: Min Chen <[email protected]>
Date: Wed, 11 Dec 2024 03:10:16 -0800
Subject: [PATCH 3/3] Fix memory leak if no command line option

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

diff --git a/source/x265cli.cpp b/source/x265cli.cpp
index 6ca6fb495..0f3fc3070 100755
--- a/source/x265cli.cpp
+++ b/source/x265cli.cpp
@@ -617,6 +617,12 @@ namespace X265_NS {

     bool CLIOptions::parse(int argc, char **argv)
     {
+        if (argc <= 1)
+        {
+            x265_log(NULL, X265_LOG_ERROR, "No input file. Run x265 --help
for a list of options.\n");
+            return true;
+        }
+
         bool bError = false;
         int bShowHelp = false;
         int inputBitDepth = 8;
@@ -636,12 +642,6 @@ namespace X265_NS {
         int svtEnabled = 0;
         argCnt = argc;

-        if (argc <= 1)
-        {
-            x265_log(NULL, X265_LOG_ERROR, "No input file. Run x265 --help
for a list of options.\n");
-            return true;
-        }
-
         /* Presets are applied before all other options. */
         for (optind = 0;;)
         {
-- 
2.35.1.windows.2

Attachment: 0003-Fix-memory-leak-if-no-command-line-option.patch
Description: Binary data

_______________________________________________
x265-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/x265-devel

Reply via email to