Skip to content

Commit

Permalink
Port C code changes to Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Bossen committed Jul 17, 2024
1 parent 82ad54c commit ce56fd9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/input/annexb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ unsafe fn parse_obu_header(
buf = buf.offset(1);
buf_size -= 1;
if extension_flag != 0 {
if buf_size == 0 {
return -1;
}
buf = buf.offset(1);
buf_size -= 1;
}
Expand Down
3 changes: 3 additions & 0 deletions tools/input/section5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ unsafe fn parse_obu_header(
buf = buf.offset(1);
buf_size -= 1;
if extension_flag != 0 {
if buf_size == 0 {
return -1;
}
buf = buf.offset(1);
buf_size -= 1;
}
Expand Down

0 comments on commit ce56fd9

Please sign in to comment.