Skip to content

Commit

Permalink
fix has_alpha() when image ID does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Oct 20, 2024
1 parent d386233 commit 9ab817b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libheif/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -916,8 +916,12 @@ Error HeifContext::interpret_heif_file()

bool HeifContext::has_alpha(heif_item_id ID) const
{
assert(is_image(ID));
auto img = m_all_images.find(ID)->second;
auto imgIter = m_all_images.find(ID);
if (imgIter == m_all_images.end()) {
return false;
}

auto img = imgIter->second;

// --- has the image an auxiliary alpha image?

Expand Down

0 comments on commit 9ab817b

Please sign in to comment.