diff --git a/libheif/image-items/image_item.cc b/libheif/image-items/image_item.cc index de3d4ce014..e44a6e0313 100644 --- a/libheif/image-items/image_item.cc +++ b/libheif/image-items/image_item.cc @@ -846,8 +846,8 @@ Result> ImageItem::decode_image(const struct hei } auto cropResult = img->crop(left, right, top, bottom, m_heif_context->get_security_limits()); - if (error) { - return error; + if (cropResult.error) { + return cropResult.error; } img = cropResult.value;