Commit 68e7882a authored by Kiran Misra's avatar Kiran Misra

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

Fixes for (a) memory leaks and (b)conditional jump based on uninitialized variable, reported by valgrind when decoding a bitstream
parent eb1390ec
......@@ -216,6 +216,8 @@ void AdaptiveLoopFilter::create( const int picWidth, const int picHeight, const
// Laplacian based activity
for( int i = 0; i < NUM_DIRECTIONS; i++ )
{
if ( m_laplacian[i] == nullptr )
{
m_laplacian[i] = new int*[m_CLASSIFICATION_BLK_SIZE + 5];
......@@ -224,13 +226,17 @@ void AdaptiveLoopFilter::create( const int picWidth, const int picHeight, const
m_laplacian[i][y] = new int[m_CLASSIFICATION_BLK_SIZE + 5];
}
}
}
// Classification
if ( m_classifier == nullptr )
{
m_classifier = new AlfClassifier*[picHeight];
for( int i = 0; i < picHeight; i++ )
{
m_classifier[i] = new AlfClassifier[picWidth];
}
}
}
void AdaptiveLoopFilter::destroy()
......
......@@ -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