diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp index b58dfdfa82ad01f8b797e62e9c6f283d4b5996cb..04faab51b41a0131cb23d0338dc598afb5a827d1 100644 --- a/source/Lib/DecoderLib/DecLib.cpp +++ b/source/Lib/DecoderLib/DecLib.cpp @@ -2456,7 +2456,11 @@ void DecLib::xDecodeVPS( InputNALUnit& nalu ) CHECK( nalu.m_temporalId, "The value of TemporalId of VPS NAL units shall be equal to 0" ); m_HLSReader.parseVPS( m_vps ); + + // storeVPS may directly delete the new VPS in case it is a repetition. Need to retrieve proper initialized memory back + int vpsID = m_vps->getVPSId(); m_parameterSetManager.storeVPS( m_vps, nalu.getBitstream().getFifo()); + m_vps = m_parameterSetManager.getVPS(vpsID); } void DecLib::xDecodeDCI(InputNALUnit& nalu)