[x265] [PATCH] Fix memory leak if no command line option
Pavan Tarun Chakka Venkata
pavan.tarun at multicorewareinc.com
Fri Dec 13 02:35:18 UTC 2024
>From f909f75116a00761253dab5a52fd6b50215ec5da Mon Sep 17 00:00:00 2001
From: Min Chen <chenm003 at 163.com>
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20241213/6963d713/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Fix-memory-leak-if-no-command-line-option.patch
Type: application/octet-stream
Size: 1205 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20241213/6963d713/attachment-0001.obj>
More information about the x265-devel
mailing list