[x265] [x265 - PATCH] abr-ladder: Fix crash due to uninitialized analysis buffer

Aruna Matheswaran aruna at multicorewareinc.com
Thu Oct 1 06:06:46 CEST 2020


>From e46d490f2fef06d5fec96c3f22f2835d64019c25 Mon Sep 17 00:00:00 2001
From: Aruna <aruna at multicorewareinc.com>
Date: Thu, 1 Oct 2020 00:28:29 +0530
Subject: [PATCH] abr-ladder: Fix crash due to uninitialized analysis buffer

---
 source/abrEncApp.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/source/abrEncApp.cpp b/source/abrEncApp.cpp
index fa62ebf63..cd85154f1 100644
--- a/source/abrEncApp.cpp
+++ b/source/abrEncApp.cpp
@@ -98,13 +98,15 @@ namespace X265_NS {
                 x265_picture_init(m_passEnc[pass]->m_param,
m_inputPicBuffer[pass][idx]);
             }

-            m_analysisBuffer[pass] = X265_MALLOC(x265_analysis_data,
m_queueSize);
+            CHECKED_MALLOC_ZERO(m_analysisBuffer[pass],
x265_analysis_data, m_queueSize);
             m_picIdxReadCnt[pass] = new ThreadSafeInteger[m_queueSize];
             m_analysisWrite[pass] = new ThreadSafeInteger[m_queueSize];
             m_analysisRead[pass] = new ThreadSafeInteger[m_queueSize];
             m_readFlag[pass] = X265_MALLOC(int, m_queueSize);
         }
         return true;
+    fail:
+        return false;
     }

     void AbrEncoder::destroy()
-- 
2.20.1.windows.1


-- 
Regards,
*Aruna Matheswaran,*
Video Codec Engineer,
Media & AI analytics BU,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20201001/ff1177da/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: abr-ladder.diff
Type: application/octet-stream
Size: 1205 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20201001/ff1177da/attachment.obj>


More information about the x265-devel mailing list