Skip to content
Permalink
Browse files Browse the repository at this point in the history
Handle case where referenced "iref" box doesn't exist (fixes #138).
  • Loading branch information
fancycode committed Aug 2, 2019
1 parent 34e984a commit f7399b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Binary file added fuzzing/corpus/github_138.heic
Binary file not shown.
6 changes: 6 additions & 0 deletions libheif/heif_context.cc
Expand Up @@ -813,6 +813,12 @@ Error HeifContext::get_id_of_non_virtual_child_image(heif_item_id id, heif_item_
image_type=="iden" ||
image_type=="iovl") {
auto iref_box = m_heif_file->get_iref_box();
if (!iref_box) {
return Error(heif_error_Invalid_input,
heif_suberror_No_item_data,
"Derived image does not reference any other image items");
}

std::vector<heif_item_id> image_references = iref_box->get_references(id, fourcc("dimg"));

// TODO: check whether this really can be recursive (e.g. overlay of grid images)
Expand Down

0 comments on commit f7399b6

Please sign in to comment.