[x265] [PATCH] Fix MCSTF double free

Pavan Tarun Chakka Venkata pavan.tarun at multicorewareinc.com
Thu Nov 21 10:13:48 UTC 2024


>From acf2075aaf20a5dc1151e2a0da6505c9d0c3bdfc Mon Sep 17 00:00:00 2001
From: Min Chen <chenm003 at 163.com>
Date: Mon, 18 Nov 2024 11:03:38 +0530
Subject: [PATCH] Fix MCSTF double free

---
 source/common/frame.cpp    | 1 +
 source/encoder/encoder.cpp | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/source/common/frame.cpp b/source/common/frame.cpp
index 3a98c23d7..200717425 100644
--- a/source/common/frame.cpp
+++ b/source/common/frame.cpp
@@ -321,6 +321,7 @@ void Frame::destroy()
         }

         delete m_mcstf->m_metld;
+        m_mcstf->m_metld = NULL;
         for (int i = 0; i < (m_mcstf->m_range << 1); i++)
             m_mcstf->destroyRefPicInfo(&m_mcstfRefList[i]);

diff --git a/source/encoder/encoder.cpp b/source/encoder/encoder.cpp
index e85e09d82..3003ac1ac 100644
--- a/source/encoder/encoder.cpp
+++ b/source/encoder/encoder.cpp
@@ -4036,7 +4036,7 @@ void Encoder::configure(x265_param *p)
     if (strlen(p->analysisLoad) && !p->analysisLoadReuseLevel)
         p->analysisLoadReuseLevel = 5;

-    if ((strlen(p->analysisLoad) || p->analysisSave) &&
(p->bDistributeModeAnalysis || p->bDistributeMotionEstimation))
+    if ((strlen(p->analysisLoad) || strlen(p->analysisSave)) &&
(p->bDistributeModeAnalysis || p->bDistributeMotionEstimation))
     {
         x265_log(p, X265_LOG_WARNING, "Analysis load/save options
incompatible with pmode/pme, Disabling pmode/pme\n");
         p->bDistributeMotionEstimation = p->bDistributeModeAnalysis = 0;
-- 
2.41.0.windows.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20241121/a289c98a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-MCSTF-Pmode-Fix.patch
Type: application/octet-stream
Size: 1518 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20241121/a289c98a/attachment.obj>


More information about the x265-devel mailing list