Skip to content

Commit

Permalink
Merge pull request IENT#490 from IENT/bugfix/AV1ParsingFixForCrash
Browse files Browse the repository at this point in the history
AV1 parsing from containers sometimes crashes
  • Loading branch information
ChristianFeldmann authored Nov 11, 2022
2 parents 49297bd + 08755bf commit 1966a97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 11 additions & 1 deletion YUViewLib/src/filesource/FileSourceFFmpegFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,17 @@ QList<QByteArray> FileSourceFFmpegFile::getParameterSets()
// This should be a normal OBU for the seuqence header starting with the OBU header
SubByteReaderLogging reader(SubByteReaderLogging::convertToByteVector(extradata), nullptr);
parser::av1::obu_header header;
header.parse(reader);
try
{
header.parse(reader);
}
catch (const std::exception &e)
{
(void)e;
DEBUG_FFMPEG("Error parsing OBU header " + e.what());
return retArray;
}

if (header.obu_type == parser::av1::ObuType::OBU_SEQUENCE_HEADER)
retArray.append(extradata);
}
Expand Down
2 changes: 0 additions & 2 deletions YUViewLib/src/parser/AV1/obu_header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ void obu_header::parse(SubByteReaderLogging &reader)
}

if (this->obu_has_size_field)
{
this->obu_size = reader.readLEB128("obu_size");
}
}

} // namespace parser::av1

0 comments on commit 1966a97

Please sign in to comment.