From 039ba6c3dcac63ca3fbf3a765342b89959e37ef5 Mon Sep 17 00:00:00 2001 From: Freaky Mutant Man Date: Sun, 26 Oct 2025 00:46:00 +0000 Subject: [PATCH] Fix anti-Stereo Mode remap check in Lua music remapping function. --- src/lua_baselib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 6582cd509..44692972d 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -489,7 +489,8 @@ static int lib_mMusicRemap(lua_State *L) } // Do not allow Lua to remap Stereo Mode tunes. - if (strncmp("stere", tune_id, 5)) + if (strlen(tune_id) > 5 + && toupper(tune_id[0]) == 'S' && toupper(tune_id[1]) == 'T' && toupper(tune_id[2]) == 'E' && toupper(tune_id[3]) == 'R' && toupper(tune_id[4]) == 'E') { return LUA_ErrStereo(L, tune_id); }