Skip to content

Commit

Permalink
fix: Catch potential OCIO exception that we were missing (AcademySoft…
Browse files Browse the repository at this point in the history
…wareFoundation#4379)

Signed-off-by: Larry Gritz <lg@larrygritz.com>
  • Loading branch information
lgritz committed Aug 22, 2024
1 parent 8d4e5b9 commit 89b49e2
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 @@ -1074,10 +1074,15 @@ ColorConfig::Impl::isColorSpaceLinear(string_view name) const
{
#if OCIO_VERSION_HEX >= MAKE_OCIO_VERSION_HEX(2, 2, 0)
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;
}
}
#endif
return Strutil::iequals(name, "linear")
Expand Down

0 comments on commit 89b49e2

Please sign in to comment.