Fix T85671: color management crash with Medium Contrast look

This commit is contained in:
Brecht Van Lommel 2021-02-16 22:37:27 +01:00
parent ba79b8013f
commit c9c4802c1c
Notes: blender-bot 2023-12-08 16:39:08 +01:00
Referenced by issue #85707, Color Management is broken when a "look" is selected
Referenced by issue #85671, OCIO crash/abort using Filmic Medium Contrast
1 changed files with 14 additions and 8 deletions

View File

@ -682,19 +682,25 @@ OCIO_ConstProcessorRcPtr *OCIOImpl::createDisplayProcessor(OCIO_ConstConfigRcPtr
}
/* Add look transform. */
const bool use_look = (strlen(look) != 0);
bool use_look = (look != nullptr && look[0] != 0);
if (use_look) {
const char *look_output = LookTransform::GetLooksResultColorSpace(
config, config->getCurrentContext(), look);
LookTransformRcPtr lt = LookTransform::Create();
lt->setSrc(input);
lt->setDst(look_output);
lt->setLooks(look);
group->appendTransform(lt);
if (look_output != nullptr && look_output[0] != 0) {
LookTransformRcPtr lt = LookTransform::Create();
lt->setSrc(input);
lt->setDst(look_output);
lt->setLooks(look);
group->appendTransform(lt);
/* Make further transforms aware of the color space change. */
input = look_output;
/* Make further transforms aware of the color space change. */
input = look_output;
}
else {
/* For empty looks, no output color space is returned. */
use_look = false;
}
}
/* Add view and display transform. */