Error resilience: Added a few error handling measures. (#581)
* * Error resilience: Added a few error handling measures. - AV1: Added check flags to sequence header and frame header to indicate if the headers are parsed without errors. The flags are used to check if the parsing process which refers to the headers can proceed or stop. - AV1: Added divide by 0 check on tile columns in tile group parsing. - AV1: Added invalid OBU size check in AV1 elementary stream parsing in bitstream reader. - All codecs: Added divide by 0 check in display aspect ratio calculation. * * Error resilience: Fixed a typo in an error message.
Этот коммит содержится в:
1 родитель
41338c40f3
Коммит
a861d6f1d2
6 files changed
+40
-9
No files matched your search
@@ -859,7 +859,7 @@ uint32_t RocVideoESParser::ReadUVLC(const uint8_t *p_stream, size_t &bit_offset)
|
||||
int RocVideoESParser::CheckAv1EStream(uint8_t *p_stream, int stream_size) {
|
||||
int score = 0;
|
||||
uint8_t *obu_stream = p_stream;
|
||||
int curr_offset = 0;
|
||||
uint32_t curr_offset = 0;
|
||||
int temporal_delimiter_obu_present = 0;
|
||||
int seq_header_obu_present = 0;
|
||||
int frame_header_obu_present = 0;
|
||||
@@ -1080,6 +1080,10 @@ int RocVideoESParser::CheckAv1EStream(uint8_t *p_stream, int stream_size) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Check before update
|
||||
if (obu_size > (stream_size - curr_offset)) {
|
||||
break;
|
||||
}
|
||||
curr_offset += obu_size;
|
||||
}
|
||||
if (syntax_error) {
|
||||
|
||||
Reference in new issue
Block a user