Commit 12dac70a authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

mscms: Handle errors from lcms more gracefully.

Default behavior of lcms is to abort the process when it encounters an error it considers fatal, such as a corrupt color profile.
parent a7b70911
......@@ -36,6 +36,23 @@
WINE_DEFAULT_DEBUG_CHANNEL(mscms);
#ifdef HAVE_LCMS
static int lcms_error_handler( int error, const char *text )
{
switch (error)
{
case LCMS_ERRC_WARNING:
case LCMS_ERRC_RECOVERABLE:
case LCMS_ERRC_ABORTED:
WARN("%d %s\n", error, debugstr_a(text));
return 1;
default:
ERR("unknown error %d %s\n", error, debugstr_a(text));
return 0;
}
}
#endif
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
{
TRACE( "(%p, %d, %p)\n", hinst, reason, reserved );
......@@ -44,6 +61,9 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls( hinst );
#ifdef HAVE_LCMS
cmsSetErrorHandler( lcms_error_handler );
#endif
break;
case DLL_PROCESS_DETACH:
#ifdef HAVE_LCMS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment