Fix #106977: Crash when OpenEXR IO fails #107184

Merged
Sergey Sharybin merged 1 commits from Sergey/blender:fix_106977 into main 2023-04-20 18:40:20 +02:00

1 Commits

Author SHA1 Message Date
Sergey Sharybin de1aee3388 Fix #106977: Crash when OpenEXR IO fails
buildbot/vexp-code-patch-coordinator Build done. Details
The crash can occur in the following situations:

- Attempt to open a corrupted EXR file
- Attempt to save an EXR file under a non-existing directory.

The root cause is not really clear: for some reason the OpenEXE API on
the Blender side can not catch OpenEXE exceptions by a constant
reference to a std::exception, although it can by a constant reference
to an Iex::BaseExc.

This does not seem to be an issue with the OpenEXR library itself as
the idiff tool from our SVN folder catches the exceptions correctly.
It is also not caused by the symbols_apple.map as erasing it does not
make the problem go away.

It could still be some compiler/visibility flag which we were unable
to nail down yet.

The proposed solution is to add catch-all cases, mimicking the OIIO
tools. This solves the problem with the downside is that there are
no friendly error messages in the terminal. Those messages could be
brought as part of the workaround by additionally catching the
Iex::BaseExc exception. But probably nobody relies on those error
prints anyway, so added complexity in the code is likely does not
worth it.
2023-04-20 17:43:48 +02:00