Skip to content

fix(obs-studio): reject NaN in validate_range#396

Open
santhreal wants to merge 1 commit into
HKUDS:mainfrom
santhreal:fix/obs-validate-range-nan-v2
Open

fix(obs-studio): reject NaN in validate_range#396
santhreal wants to merge 1 commit into
HKUDS:mainfrom
santhreal:fix/obs-validate-range-nan-v2

Conversation

@santhreal

Copy link
Copy Markdown

validate_range is used for opacity, volume, and similar bounded floats. NaN made both min and max comparisons false, so the value was accepted and could be written into project JSON.

Non-finite values are now rejected before the range check.

Repro: validate_range(float("nan"), 0.0, 1.0, "Opacity") returned nan on main and now raises ValueError.

NaN bypassed min/max checks because NaN comparisons are always false,
so invalid opacity/volume values could be stored. Reject non-finite
floats before the range compare.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

existing-cli-fix Fixes or improves an existing CLI harness

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant