SThreshold: crash when loading a bitmap image
Summary
SThreshold misbehaves or crashes at worst, when using a bitmap image. The service only expects a 3D image via an assert (https://git.ircad.fr/Sight/sight/blob/dev/Bundles/op/opImageFilter/src/opImageFilter/SThreshold.cpp#L119), but the assert is not triggered when in release or relwithdebinfo, if I understood well.
Steps to reproduce
- Build & Launch Tuto06Filter
- Open a jpeg or png image
- Compute image filter
- Expect a crash
Dev environment
- OS: Linux
- CMake version: 3.13.2
- Compiler: gcc 7.4.0
- Build type: relwithdebinfo
- Commit: 39f85f58
What is the current bug behavior?
While going through the SThreshold filter with a bitmap image, the last dimension of the input image will be 0, which will sometime trigger a crash, sometimes not.
What is the expected correct behavior?
No crash.
Possible fixes
- Either enforce the test on the fact that the input image must be 3D, and signal to the user if the image is not
- Or handle 2D images correctly (e.g. what was done here: https://git.ircad.fr/Sight/sight/merge_requests/88)