color-device: Make sure lcms_context is not NULL
lcms interprets a NULL context as using a default, non-thread-safe context, which is unsuitable for mutter's use. Make sure we're always using a non-trivial context. Helps: https://gitlab.gnome.org/GNOME/mutter/-/issues/2659 Signed-off-by: Simon McVittie <smcv@debian.org> Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2877>
This commit is contained in:
parent
f447c0df18
commit
e2be2d271b
1 changed files with 8 additions and 1 deletions
|
@ -846,6 +846,14 @@ create_icc_profile_from_edid (MetaColorDevice *color_device,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
lcms_context = meta_color_manager_get_lcms_context (color_manager);
|
||||
if (!lcms_context)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"Internal error: no LCMS context available");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cd_icc = cd_icc_new ();
|
||||
|
||||
chroma.Red.x = edid_info->red_x;
|
||||
|
@ -863,7 +871,6 @@ create_icc_profile_from_edid (MetaColorDevice *color_device,
|
|||
transfer_curve[1] = transfer_curve[0];
|
||||
transfer_curve[2] = transfer_curve[0];
|
||||
|
||||
lcms_context = meta_color_manager_get_lcms_context (color_manager);
|
||||
lcms_profile = cmsCreateRGBProfileTHR (lcms_context,
|
||||
&white_point,
|
||||
&chroma,
|
||||
|
|
Loading…
Reference in a new issue