Skip to content

Commit

Permalink
uncompressed: add version checks for cmpC and icbr
Browse files Browse the repository at this point in the history
  • Loading branch information
bradh committed Jul 9, 2024
1 parent 25d0c77 commit 86299ef
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions libheif/codecs/uncompressed_box.cc
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,11 @@ Error Box_uncC::write(StreamWriter& writer) const
Error Box_cmpC::parse(BitstreamRange& range)
{
parse_full_box_header(range);

if (get_version() != 0) {
return unsupported_version_error("cmpC");
}

compression_type = range.read32();
uint8_t v = range.read8();
must_decompress_individual_entities = ((v & 0x80) == 0x80);
Expand Down Expand Up @@ -402,6 +407,11 @@ Error Box_cmpC::write(StreamWriter& writer) const
Error Box_icbr::parse(BitstreamRange& range)
{
parse_full_box_header(range);

if ((get_version() != 0) && (get_version() != 1)) {
return unsupported_version_error("icbr");
}

uint32_t num_ranges = range.read32();
for (uint32_t r = 0; r < num_ranges; r++) {
struct ByteRange byteRange;
Expand Down

0 comments on commit 86299ef

Please sign in to comment.