Diffusion MITK bed03667f06b

Avoid crashes at extreme level window ranges


Avoid crashes at extreme level window ranges

Fixes T29341 . Takes care of extreme values for the level window range, which would cause problems when exceeding the possible range of floating point values.
I introduced a simple check inside the level window itself, that clamps any values at the maximum/lowest floating point value, to ensure staying inside its available range.
Additionally, I raised several variables in the level window widget from float to double so that the widget can calculate its values without running into infinity or NaN. Anything exceeding the float range will then be limited by the level window.

Test Plan: Load any image and move the level window to a range around 3.4 * 10^38 (positive or negative). At that point, the values should stop increasing (/decreasing), with the maximum (/minimum) border of the level window widget remaining fixed. There is no crash anymore.

Reviewers: O3 MITK Reviewer Group II, O1 MITK Reviewer Group I, floca

Reviewed By: O3 MITK Reviewer Group II, O1 MITK Reviewer Group I, floca

Subscribers: floca, kislinsk

Maniphest Tasks: T29341

Differential Revision: https://phabricator.mitk.org/D737


s434nAuthored on Oct 20 2022, 11:48 AM
s434nPushed on Oct 21 2022, 11:40 AM
O3: MITK Reviewer Group II
Differential Revision
Restricted Differential Revision
rMITK29d874a94745: mention hardcoded level window bounds in documentation
rMITK3b33c8355436: Immediately apply "Show only selected nodes"
T29341: Moving the LevelWindow slider too many times at extreme ranges makes MITK crash.