>From acf2075aaf20a5dc1151e2a0da6505c9d0c3bdfc Mon Sep 17 00:00:00 2001
From: Min Chen <[email protected]>
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

Attachment: 0006-MCSTF-Pmode-Fix.patch
Description: Binary data

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

Reply via email to