Added bitstream validation code for HEVC parser (#450)

* fix for while loop hang

* fix for while loop hang

* add more data validation code in parser

* minor change

* addressed review comments

* fix conformance failures with new code

* added more checks
This commit is contained in:
Rajy Rawther
2024-11-11 14:33:17 -08:00
zatwierdzone przez GitHub
rodzic 8e1cb24851
commit 69ec7af8bd
4 zmienionych plików z 47 dodań i 9 usunięć
+4 -3
Wyświetl plik
@@ -139,11 +139,12 @@ ParserResult RocVideoParser::GetNalUnit() {
start_code_found = true;
start_code_num_++;
next_start_code_offset_ = curr_byte_offset_;
// Move the pointer 3 bytes forward
curr_byte_offset_ += 3;
// Move the pointer (3 + 2) bytes forward (start_code + nal header)
curr_byte_offset_ += 5;
// For the very first NAL unit, search for the next start code (or reach the end of frame)
if (start_code_num_ == 1) {
// also detect empty nal units with no data
if (start_code_num_ == 1 ) {
start_code_found = false;
curr_start_code_offset_ = next_start_code_offset_;
continue;