From c797d4ccba33c8ce56d518f4d8408ac8996144ab Mon Sep 17 00:00:00 2001 From: ? Date: Wed, 27 Feb 2019 18:01:10 +0100 Subject: [PATCH] racing:: fixed a potential crash if goal not found --- racing.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/racing.cpp b/racing.cpp index 7085a971..ac9cfce0 100644 --- a/racing.cpp +++ b/racing.cpp @@ -1294,8 +1294,12 @@ void markers() { using namespace racing; cell *goal = NULL; for(cell *c: track) if(inscreenrange(c)) goal = c; + + if(!goal) return; + hyperpoint H = tC0(ggmatrix(goal)); if(invalid_point(H)) return; + queuechr(H, 2*vid.fsize, 'X', 0x10100 * int(128 + 100 * sintick(150))); queuestr(H, vid.fsize, #if CAP_CRYSTAL