sign_t profile_class, color_space, pcs;
+ babl_mutex_lock (babl_space_mutex);
+
if (!error) error = &int_err;
*error = NULL;
{
ret = _babl_space_for_lcms (icc_data, icc_length);
if (!ret)
+ {
+ babl_mutex_unlock (babl_space_mutex);
return NULL;
+ }
if (ret->space.icc_type == BablICCTypeCMYK)
+ {
+ babl_mutex_unlock (babl_space_mutex);
return ret;
+ }
ret->space.icc_length = icc_length;
ret->space.icc_profile = malloc (icc_length);
if (!ret->space.icc_profile)
+ {
+ babl_mutex_unlock (babl_space_mutex);
return NULL;
+ }
memcpy (ret->space.icc_profile, icc_data, icc_length);
#ifdef HAVE_LCMS
cmsCloseProfile (ret->space.cmyk.lcms_profile); // XXX keep it open in case of CMYK to CMYK transforms needed?
#endif
ret->space.icc_type = BablICCTypeCMYK;
+ babl_mutex_unlock (babl_space_mutex);
return ret;
}
{
babl_free (state);
+ babl_mutex_unlock (babl_space_mutex);
return NULL;
}
ret->space.icc_profile = malloc (icc_length);
memcpy (ret->space.icc_profile, icc_data, icc_length);
babl_free (state);
+ babl_mutex_unlock (babl_space_mutex);
return ret;
*error = "Inconsistent ICC profile detected, profile contains both cLUTs and a matrix with swapped primaries, this likely means it is an intentionally inconsistent Argyll profile is in use; this profile is only capable of high accuracy rendering and does not permit acceleration for interactive previews.";
fprintf (stderr, "babl ICC warning: %s\n", *error);
babl_free (state);
+ babl_mutex_unlock (babl_space_mutex);
return NULL;
}
}
if (ret)
{
babl_free (state);
+ babl_mutex_unlock (babl_space_mutex);
return ret;
}
ret->space.icc_length = icc_length;
ret->space.icc_profile = malloc (icc_length);
memcpy (ret->space.icc_profile, icc_data, icc_length);
+ babl_mutex_unlock (babl_space_mutex);
return ret;
}
}
if (phosporant != 0)
{
*error = "unhandled phosporants, please report bug against babl with profile";
+ babl_mutex_unlock (babl_space_mutex);
return NULL;
}
if (channels != 3)
{
*error = "unexpected non 3 count of channels";
+ babl_mutex_unlock (babl_space_mutex);
return NULL;
}
ret->space.icc_profile = malloc (icc_length);
memcpy (ret->space.icc_profile, icc_data, icc_length);
+ babl_mutex_unlock (babl_space_mutex);
return ret;
}
}
}
babl_free (state);
+ babl_mutex_unlock (babl_space_mutex);
return NULL;
}
BablMutex *babl_debug_mutex;
#endif
BablMutex *babl_reference_mutex;
+BablMutex *babl_space_mutex;
void
babl_internal_init (void)
babl_fish_mutex = babl_mutex_new ();
babl_format_mutex = babl_mutex_new ();
babl_reference_mutex = babl_mutex_new ();
+ babl_space_mutex = babl_mutex_new ();
#if BABL_DEBUG_MEM
babl_debug_mutex = babl_mutex_new ();
#endif