Commit 1ca7f9ec authored by Xiang Li's avatar Xiang Li

Merge branch 'Valgrind-related-bugfixes' into 'master'

Fixes for (a) memory leaks and (b)conditional jump based on uninitialized…

See merge request jvet/VVCSoftware_BMS!87
parents 9f4195e0 68e7882a
Pipeline #57 passed with stage
......@@ -217,19 +217,25 @@ void AdaptiveLoopFilter::create( const int picWidth, const int picHeight, const
// Laplacian based activity
for( int i = 0; i < NUM_DIRECTIONS; i++ )
{
m_laplacian[i] = new int*[m_CLASSIFICATION_BLK_SIZE + 5];
for( int y = 0; y < m_CLASSIFICATION_BLK_SIZE + 5; y++ )
if ( m_laplacian[i] == nullptr )
{
m_laplacian[i][y] = new int[m_CLASSIFICATION_BLK_SIZE + 5];
m_laplacian[i] = new int*[m_CLASSIFICATION_BLK_SIZE + 5];
for( int y = 0; y < m_CLASSIFICATION_BLK_SIZE + 5; y++ )
{
m_laplacian[i][y] = new int[m_CLASSIFICATION_BLK_SIZE + 5];
}
}
}
// Classification
m_classifier = new AlfClassifier*[picHeight];
for( int i = 0; i < picHeight; i++ )
if ( m_classifier == nullptr )
{
m_classifier[i] = new AlfClassifier[picWidth];
m_classifier = new AlfClassifier*[picHeight];
for( int i = 0; i < picHeight; i++ )
{
m_classifier[i] = new AlfClassifier[picWidth];
}
}
}
......
......@@ -195,7 +195,7 @@ bool CABACReader::coding_tree_unit( CodingStructure& cs, const UnitArea& area, i
ctx += leftCTUAddr > -1 ? ( ctbAlfFlag[leftCTUAddr] ? 1 : 0 ) : 0;
ctx += aboveCTUAddr > -1 ? ( ctbAlfFlag[aboveCTUAddr] ? 1 : 0 ) : 0;
if( alfSliceParam.chromaCtbPresentFlag && compIdx )
if( compIdx && alfSliceParam.chromaCtbPresentFlag )
{
ctbAlfFlag[ctuRsAddr] = 1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment