SDL_SetWindowProgressState(): Add parameter validation check for `state`

This commit is contained in:
Petar Popovic 2025-03-23 16:57:43 +01:00 committed by Sam Lantinga
parent 3fa1bd81fe
commit c217663fba
1 changed files with 4 additions and 0 deletions

View File

@ -3926,6 +3926,10 @@ bool SDL_SetWindowProgressState(SDL_Window *window, SDL_ProgressState state)
CHECK_WINDOW_MAGIC(window, false);
CHECK_WINDOW_NOT_POPUP(window, false);
if (state < SDL_PROGRESS_STATE_NONE || state > SDL_PROGRESS_STATE_ERROR) {
return SDL_InvalidParamError("state");
}
if (_this->SetWindowProgressState) {
return _this->SetWindowProgressState(_this, window, state);
}