From 838792fca41b9bccce260e9500d75549433bbe6a Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sun, 18 May 2025 11:10:09 -0700 Subject: Add bounds check to set_sand() Previously, painting didn't do it (simulation did) so there were buffer overruns --- src/ui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui.cpp') diff --git a/src/ui.cpp b/src/ui.cpp index 64a8a91..4337a3d 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -105,7 +105,7 @@ static void paint_sand(Sandbox& sb, const Tile& palette, Pt pt, BrushType type, int x0 = pt.x - size / 2; for (int y = y0; y < y0 + size; ++y) { for (int x = x0; x < x0 + size; ++x) { - sb.set_sand(x, y, palette); + sb.ss(x, y, palette); } } } break; -- cgit v1.2.3-70-g09d2