summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/draw13.cpp
diff options
context:
space:
mode:
author Rob <therobkellett@gmail.com>2023-07-31 15:15:52 -0400
committer GitHub <noreply@github.com>2023-08-01 05:15:52 +1000
commit8c0dae39ff391b9186048048019c5cb5500aa0a3 (patch)
tree7e934d9bca8e30669ddc7baadd1a17f7a44a1337 /src/osd/modules/render/draw13.cpp
parent54d9a4cff975001cddca38a57e2779513cfaa057 (diff)
render/draw13.cpp: Avoid divide-by-zero with low-resolution time source. (#11442)
Emscripten builds are affected as clock resolution is intentionally degraded to mitigate side channel exfiltration attacks.
Diffstat (limited to 'src/osd/modules/render/draw13.cpp')
-rw-r--r--src/osd/modules/render/draw13.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/osd/modules/render/draw13.cpp b/src/osd/modules/render/draw13.cpp
index d958de6adfb..a36ee8a8f52 100644
--- a/src/osd/modules/render/draw13.cpp
+++ b/src/osd/modules/render/draw13.cpp
@@ -365,7 +365,7 @@ void renderer_sdl2::render_quad(texture_info *texture, const render_primitive &p
copyinfo->time += (m_last_blit_time * (int64_t) (texture->raw_width() * texture->raw_height())) / (int64_t) m_last_blit_pixels;
}
copyinfo->samples++;
- copyinfo->perf = ( texture->m_copyinfo->pixel_count * (osd_ticks_per_second()/1000)) / texture->m_copyinfo->time;
+ copyinfo->perf = (texture->m_copyinfo->pixel_count * (osd_ticks_per_second()/1000)) / std::max<int64_t>(texture->m_copyinfo->time, 1);
}
else
{