diff options
author | Arisotura <thetotalworm@gmail.com> | 2019-04-27 20:53:58 +0200 |
---|---|---|
committer | Arisotura <thetotalworm@gmail.com> | 2019-04-27 20:53:58 +0200 |
commit | 85b3bdebd1258a13b3d28eeff5a7eef2d22fb5d9 (patch) | |
tree | 7d1e6a7ae6794b05b982027ac20ed74fcd775e9d | |
parent | b9703d2e8f25c0dc20ff709505a8b6888041f4f8 (diff) |
avoid potential division by zero in framerate counting when running uberfast. likely fixes #394
-rw-r--r-- | src/libui_sdl/main.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 566b346..3eea39c 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -578,7 +578,9 @@ int EmuThreadFunc(void* burp) u32 diff = tick - lastmeasuretick; lastmeasuretick = tick; - u32 fps = (nframes * 1000) / diff; + u32 fps; + if (diff < 1) fps = 77777; + else fps = (nframes * 1000) / diff; nframes = 0; float fpstarget; |