Skip to content

Commit da4e4b6

Browse files
committed
Handle case where decoding returns no image.
Triggered by "fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5752063708495872.heic".
1 parent 51e8e4c commit da4e4b6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libheif/image-items/image_item.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,10 @@ Result<std::shared_ptr<HeifPixelImage>> ImageItem::decode_image(const heif_decod
708708
}
709709

710710
auto img = *decodingResult;
711+
if (!img) {
712+
// Can happen if missing tiled image is decoded in non-strict mode.
713+
return Error(heif_error_Decoder_plugin_error, heif_suberror_Unspecified);
714+
}
711715

712716
std::shared_ptr<HeifFile> file = m_heif_context->get_heif_file();
713717

0 commit comments

Comments
 (0)