Opened 4 years ago

Last modified 3 years ago

#1482 new defect

static Rom g_Rom is not free

Reported by: spartazhc Owned by:
Priority: minor Milestone:
Component: VTM Version: VTM-12.0
Keywords: Cc: spartazhc@…, ksuehring, XiangLi, fbossen, jvet@…

Description (last modified by ksuehring)

source/Lib/CommonLib/DepQuant.cpp:338 static Rom g_Rom;
There is no free for static Rom g_Rom, which will cause segment fault if I write an another encoderApp and encode some video multiple times.
I haven't read the context, but uninitiate it manually could fix it.

diff --git a/source/Lib/CommonLib/DepQuant.cpp b/source/Lib/CommonLib/DepQuant.cpp
index 2e914d0b..6e625b15 100644
--- a/source/Lib/CommonLib/DepQuant.cpp
+++ b/source/Lib/CommonLib/DepQuant.cpp
@@ -132,6 +132,7 @@ namespace DQIntern
     Rom() : m_scansInitialized(false) {}
     ~Rom() { xUninitScanArrays(); }
     void                init        ()                       { xInitScanArrays(); }
+    void                uninit      ()                       { xUninitScanArrays(); }
     const NbInfoSbb*    getNbInfoSbb( int hd, int vd ) const { return m_scanId2NbInfoSbbArray[hd][vd]; }
     const NbInfoOut*    getNbInfoOut( int hd, int vd ) const { return m_scanId2NbInfoOutArray[hd][vd]; }
     const TUParameters* getTUPars   ( const CompArea& area, const ComponentID compID ) const
@@ -1590,6 +1591,7 @@ DepQuant::DepQuant( const Quant* other, bool enc ) : QuantRDOQ( other )
 
 DepQuant::~DepQuant()
 {
+  DQIntern::g_Rom.uninit();
   delete static_cast<DQIntern::DepQuant*>(p);
 }

Change history (1)

comment:1 Changed 3 years ago by ksuehring

  • Description modified (diff)
Note: See TracTickets for help on using tickets.