Skip to content

Commit

Permalink
fix: Catch potential OCIO exception that we were missing (#4379)
Browse files Browse the repository at this point in the history
Signed-off-by: Larry Gritz <[email protected]>
  • Loading branch information
lgritz authored Aug 21, 2024
1 parent a47c073 commit 956ce13
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/libOpenImageIO/color_ocio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,10 +1025,15 @@ bool
ColorConfig::Impl::isColorSpaceLinear(string_view name) const
{
if (config_ && !disable_builtin_configs && !disable_ocio) {
return config_->isColorSpaceLinear(c_str(name),
OCIO::REFERENCE_SPACE_SCENE)
|| config_->isColorSpaceLinear(c_str(name),
OCIO::REFERENCE_SPACE_DISPLAY);
try {
return config_->isColorSpaceLinear(c_str(name),
OCIO::REFERENCE_SPACE_SCENE)
|| config_->isColorSpaceLinear(c_str(name),
OCIO::REFERENCE_SPACE_DISPLAY);
} catch (const std::exception& e) {
error("ColorConfig error: {}", e.what());
return false;
}
}
return Strutil::iequals(name, "linear")
|| Strutil::istarts_with(name, "linear ")
Expand Down

0 comments on commit 956ce13

Please sign in to comment.