Color Management: fix segfault when configuration file is missing

Also don't try to load configuration file from environment variable if
it contains empty string.
This commit is contained in:
Sergey Sharybin
2012-09-13 13:08:31 +00:00
parent de7a57a242
commit f631ae9f46

View File

@@ -573,7 +573,7 @@ void IMB_colormanagement_init(void)
ocio_env = getenv("OCIO");
if (ocio_env)
if (ocio_env && ocio_env[0] != '\0')
config = OCIO_configCreateFromEnv();
if (config == NULL) {
@@ -590,9 +590,9 @@ void IMB_colormanagement_init(void)
OCIO_setCurrentConfig(config);
colormanage_load_config(config);
}
OCIO_configRelease(config);
OCIO_configRelease(config);
}
#endif
BLI_init_srgb_conversion();