From a5aa05ce219ea0dea853502ceb21024056c2bf23 Mon Sep 17 00:00:00 2001 From: Junior Date: Sun, 6 Sep 2026 00:55:32 +0200 Subject: [PATCH] Draw the editor team selector for MAX_COUNT teams only Team::MAX_COUNT is 12, but TeamColorSelector::draw still looped to 16. Indexing teams[12..15] is undefined, so GCC at -O3 drops the loop bound entirely and the release build reads past the array until it hits a garbage pointer: Editor, New Map, Ok segfaults. The selector is 6 x 2 cells, which already matches 12. --- src/MapEdit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MapEdit.cpp b/src/MapEdit.cpp index 30885aea6..afb8b5e5b 100644 --- a/src/MapEdit.cpp +++ b/src/MapEdit.cpp @@ -124,7 +124,7 @@ TeamColorSelector::TeamColorSelector(MapEdit& me, const widgetRectangle& area, c void TeamColorSelector::draw() { - for(int n=0; n<16; ++n) + for(int n=0; n