Commit 43b1850c authored by Remy Foray's avatar Remy Foray

Fix #1411: Decoder crash when decoding a CRA picture following an EOS

parent 71f7236f
Pipeline #5991 passed with stage
in 23 minutes and 2 seconds
......@@ -142,6 +142,7 @@ uint32_t DecApp::decode()
bool bPicSkipped = false;
bool isEosPresentInPu = false;
bool isEosPresentInLastPu = false;
#if JVET_S0078_NOOUTPUTPRIORPICFLAG
bool firstSliceInAU = true;
#endif
......@@ -206,16 +207,23 @@ uint32_t DecApp::decode()
xFlushOutput(pcListPic, nalu.m_nuhLayerId);
#endif
}
if (m_cDecLib.getFirstSliceInPicture() && nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA && isEosPresentInPu)
else if (m_cDecLib.getFirstSliceInPicture() && nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA && isEosPresentInLastPu)
{
// A CRA that is immediately preceded by an EOS is a CLVSS
m_newCLVS[nalu.m_nuhLayerId] = true;
#if !JVET_S0078_NOOUTPUTPRIORPICFLAG
xFlushOutput(pcListPic, nalu.m_nuhLayerId);
#endif
}
else if (m_cDecLib.getFirstSliceInPicture() && nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA && !isEosPresentInPu)
else if (m_cDecLib.getFirstSliceInPicture() && nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA && !isEosPresentInLastPu)
{
// A CRA that is not immediately precede by an EOS is not a CLVSS
m_newCLVS[nalu.m_nuhLayerId] = false;
}
else if(m_cDecLib.getFirstSliceInPicture() && !isEosPresentInLastPu)
{
m_newCLVS[nalu.m_nuhLayerId] = false;
}
// parse NAL unit syntax if within target decoding layer
if( ( m_iMaxTemporalLayer < 0 || nalu.m_temporalId <= m_iMaxTemporalLayer ) && xIsNaluWithinTargetDecLayerIdSet( &nalu ) )
......@@ -398,7 +406,7 @@ uint32_t DecApp::decode()
{
if (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
|| nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
|| (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA && isEosPresentInPu))
|| (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA && isEosPresentInLastPu))
{
firstPicInCVSAUThatIsNotAU0 = true;
}
......@@ -437,6 +445,7 @@ uint32_t DecApp::decode()
m_cDecLib.checkSeiInPictureUnit();
m_cDecLib.resetPictureSeiNalus();
// reset the EOS present status for the next PU check
isEosPresentInLastPu = isEosPresentInPu;
isEosPresentInPu = false;
}
if (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS)
......
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