From 3b0757bd825b30670c0dd2da6dd4f439d9056c54 Mon Sep 17 00:00:00 2001 From: Misa Date: Fri, 2 Feb 2024 15:00:44 -0800 Subject: [PATCH] Add bounds check to setlinegap This is for consistency with all other functions dealing with the latest created text box. There are several cases in custom levels where these functions can be called even though there are no text boxes on screen. --- desktop_version/src/Graphics.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 537eb789..3813c162 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -1508,6 +1508,12 @@ void Graphics::textboxadjust(void) void Graphics::setlinegap(int customvalue) { + if (!INBOUNDS_VEC(m, textboxes)) + { + vlog_error("setlinegap() out-of-bounds!"); + return; + } + textboxes[m].linegap = customvalue; textboxes[m].resize(); }