From fdfba9be50c9d5a7a219e3d768ff6ec81ef3517d Mon Sep 17 00:00:00 2001 From: Jesse Ruderman Date: Sun, 11 Jul 2021 19:47:56 -0700 Subject: [PATCH] Fix UB in draw_gravity_particles --- celldrawer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/celldrawer.cpp b/celldrawer.cpp index bf262277..46865f2b 100644 --- a/celldrawer.cpp +++ b/celldrawer.cpp @@ -2510,9 +2510,9 @@ void celldrawer::add_map_effects() { } void celldrawer::draw_gravity_particles() { - int u = (int)(size_t)(c); + unsigned int u = (unsigned int)(size_t)(c); u = ((u * 137) + (u % 1000) * 51) % 1000; - int tt = ticks + u; fractick(ticks, 900); + int tt = ticks + u; ld r0 = (tt % 900) / 1100.; ld r1 = (tt % 900 + 200) / 1100.;