Skip to content

Commit

Permalink
fix integer underflow (#1010)
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Oct 24, 2023
1 parent f69ca4d commit 316291a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libheif/box.cc
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ Error Box::read(BitstreamRange& range, std::shared_ptr<Box>* result)
}

int64_t box_size = static_cast<int64_t>(hdr.get_box_size());
int64_t box_size_without_header = box_size - hdr.get_header_size();
int64_t box_size_without_header = hdr.has_fixed_box_size() ? (box_size - hdr.get_header_size()) : (int64_t)range.get_remaining_bytes();

// Box size may not be larger than remaining bytes in parent box.

Expand Down

0 comments on commit 316291a

Please sign in to comment.