Skip to content

Commit 95428fd

Browse files
committed
remove unused variable in HeifFile::get_uncompressed_item_data()
1 parent fcce538 commit 95428fd

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

libheif/file.cc

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -626,12 +626,11 @@ Result<std::vector<uint8_t>> HeifFile::get_uncompressed_item_data(heif_item_id I
626626
// --- decompress data
627627

628628
Error error;
629-
bool read_uncompressed = true;
629+
630630
if (item_type == fourcc("mime")) {
631631
std::string encoding = infe_box->get_content_encoding();
632632
if (encoding == "compress_zlib") {
633633
#if HAVE_ZLIB
634-
read_uncompressed = false;
635634
std::vector<uint8_t> compressed_data;
636635
error = m_iloc_box->read_data(ID, m_input_stream, m_idat_box, &compressed_data, m_limits);
637636
if (error) {
@@ -647,7 +646,6 @@ Result<std::vector<uint8_t>> HeifFile::get_uncompressed_item_data(heif_item_id I
647646
}
648647
else if (encoding == "deflate") {
649648
#if HAVE_ZLIB
650-
read_uncompressed = false;
651649
std::vector<uint8_t> compressed_data;
652650
error = m_iloc_box->read_data(ID, m_input_stream, m_idat_box, &compressed_data, m_limits);
653651
if (error) {
@@ -662,7 +660,6 @@ Result<std::vector<uint8_t>> HeifFile::get_uncompressed_item_data(heif_item_id I
662660
}
663661
else if (encoding == "br") {
664662
#if HAVE_BROTLI
665-
read_uncompressed = false;
666663
std::vector<uint8_t> compressed_data;
667664
error = m_iloc_box->read_data(ID, m_input_stream, m_idat_box, &compressed_data, m_limits);
668665
if (error) {
@@ -675,20 +672,22 @@ Result<std::vector<uint8_t>> HeifFile::get_uncompressed_item_data(heif_item_id I
675672
encoding);
676673
#endif
677674
}
678-
}
679-
680-
if (read_uncompressed) {
681-
std::vector<uint8_t> data;
682-
Error error = m_iloc_box->read_data(ID, m_input_stream, m_idat_box, &data, m_limits);
683-
if (error) {
684-
return error;
685-
}
686-
else {
687-
return data;
675+
else if (!encoding.empty()) {
676+
return Error(heif_error_Unsupported_feature, heif_suberror_Unsupported_codec);
688677
}
689678
}
690679

691-
return Error(heif_error_Unsupported_feature, heif_suberror_Unsupported_codec);
680+
681+
// --- read uncompressed
682+
683+
std::vector<uint8_t> data;
684+
error = m_iloc_box->read_data(ID, m_input_stream, m_idat_box, &data, m_limits);
685+
if (error) {
686+
return error;
687+
}
688+
else {
689+
return data;
690+
}
692691
}
693692

694693

0 commit comments

Comments
 (0)