AGS: Engine: prevent invalid parameter in video player

partially from upstream 4efaf8116a2bd0bcf909b174dc28b945e4b52745
This commit is contained in:
Walter Agazzi 2023-01-17 01:11:34 +01:00 committed by Thierry Crozat
parent 43bdb0d5c5
commit 902b92341d

View File

@ -41,6 +41,9 @@ std::chrono::microseconds GetFrameDuration() {
}
int setTimerFps(int new_fps) {
assert(new_fps >= 0);
if (new_fps <= 0)
return _G(framerate);
int old_fps = _G(framerate);
_G(tick_duration) = std::chrono::microseconds(1000000LL / new_fps);
_G(framerate) = new_fps;