cmsCloseProfile(profile);
return static_cast<guchar *>(data);
}
- else
- {
- cmsCloseProfile(profile);
- return nullptr;
- }
- }
- else
- {
+
+ cmsCloseProfile(profile);
return nullptr;
}
+
+ return nullptr;
}
guchar *heif_color_profile(FileData *fd, guint *profile_len)
return static_cast<guchar *>(data);
}
- else
- {
- error_code = heif_image_handle_get_nclx_color_profile(handle, &nclxcp);
- if (error_code.code)
- {
- log_printf("warning: heif reader error: %s\n", error_code.message);
- heif_context_free(ctx);
- heif_nclx_color_profile_free(nclxcp);
- return nullptr;
- }
- profile = nclx_to_lcms_profile(nclxcp, profile_len);
+ error_code = heif_image_handle_get_nclx_color_profile(handle, &nclxcp);
+ if (error_code.code)
+ {
+ log_printf("warning: heif reader error: %s\n", error_code.message);
+ heif_context_free(ctx);
+ heif_nclx_color_profile_free(nclxcp);
+ return nullptr;
}
+ profile = nclx_to_lcms_profile(nclxcp, profile_len);
+
heif_context_free(ctx);
heif_nclx_color_profile_free(nclxcp);