Skip to content

Commit

Permalink
Merge pull request #1048 from bradh/issue1044
Browse files Browse the repository at this point in the history
uncompressed: protect against broken uncC box component references
  • Loading branch information
farindk authored Nov 30, 2023
2 parents f2d30c3 + 440c2a5 commit 12d8b6b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libheif/uncompressed_image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,9 @@ int UncompressedImageCodec::get_luma_bits_per_pixel_from_configuration_unci(cons
int alternate_channel_bits = 0;
for (Box_uncC::Component component : uncC_box->get_components()) {
uint16_t component_index = component.component_index;
if (component_index >= cmpd_box->get_components().size()) {
return -1;
}
auto component_type = cmpd_box->get_components()[component_index].component_type;
switch (component_type) {
case component_type_monochrome:
Expand Down

0 comments on commit 12d8b6b

Please sign in to comment.