Skip to content

Commit c324f73

Browse files
committed
uncompressed: fix up reading of uncompressed images that use the uncC short form
1 parent 77ceeb0 commit c324f73

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

libheif/codecs/uncompressed_image.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,16 @@ int UncompressedImageCodec::get_luma_bits_per_pixel_from_configuration_unci(cons
325325
std::shared_ptr<Box_uncC> uncC_box = std::dynamic_pointer_cast<Box_uncC>(box1);
326326
auto box2 = ipco->get_property_for_item_ID(imageID, ipma, fourcc("cmpd"));
327327
std::shared_ptr<Box_cmpd> cmpd_box = std::dynamic_pointer_cast<Box_cmpd>(box2);
328-
if (!uncC_box || !cmpd_box) {
328+
if (!uncC_box) {
329329
return -1;
330330
}
331+
if (!cmpd_box) {
332+
if (isKnownUncompressedFrameConfigurationBoxProfile(uncC_box)) {
333+
return 8;
334+
} else {
335+
return -1;
336+
}
337+
}
331338

332339
int luma_bits = 0;
333340
int alternate_channel_bits = 0;

0 commit comments

Comments
 (0)