Fixed a bug in reference picture list modification parsing. (#143)

* * rocDecode/HEVC: Fixed the random crash associated with undecodable RASL pictures.
  - When a CRA picutre occurs, all the pictures in the DPB are emptied. However, the following RASL (Random Access Skipped Leading) picture can still reference these emptied pictures, making them undecodeble.
  - We initialized the reference picture lists with (0xFF), representing invalid picture index. Normally these invalid indices are replaced by valid values during RPS decoding. However, on undecodable RASL pictures, we can not find an existing reference picture in DPB, leaving the invalid index untouched and resulting invalid indexing later on.
  - Now we initialize the reference picture lists with a valid value 0. Also we add index range check on reference buffer at VA-API layer to avoid invalid memory access.

* * rocDecode/HEVC: Fixed a typo in sampel app message.

* *rocDecode/HEVC: Fixed a bug in reference picture list modification parsing.
  - This fixed the test failure of two conformance streams.

[ROCm/rocdecode commit: c9cfcde12d]
This commit is contained in:
jeffqjiangNew
2023-12-15 16:08:19 -05:00
کامیت شده توسط GitHub
والد 7b2035c071
کامیت 8d44a48ee0
@@ -1781,7 +1781,7 @@ bool HEVCVideoParser::ParseSliceHeader(uint8_t *nalu, size_t size) {
m_sh_->ref_pic_list_modification_flag_l0 = Parser::GetBit(nalu, offset);
if (m_sh_->ref_pic_list_modification_flag_l0) {
for (int i = 0; i < m_sh_->num_ref_idx_l0_active_minus1; i++) {
for (int i = 0; i <= m_sh_->num_ref_idx_l0_active_minus1; i++) {
m_sh_->list_entry_l0[i] = Parser::ReadBits(nalu, offset, list_entry_bits);
}
}
@@ -1789,7 +1789,7 @@ bool HEVCVideoParser::ParseSliceHeader(uint8_t *nalu, size_t size) {
if (m_sh_->slice_type == HEVC_SLICE_TYPE_B) {
m_sh_->ref_pic_list_modification_flag_l1 = Parser::GetBit(nalu, offset);
if (m_sh_->ref_pic_list_modification_flag_l1) {
for (int i = 0; i < m_sh_->num_ref_idx_l1_active_minus1; i++) {
for (int i = 0; i <= m_sh_->num_ref_idx_l1_active_minus1; i++) {
m_sh_->list_entry_l1[i] = Parser::ReadBits(nalu, offset, list_entry_bits);
}
}