From 40b1cd6d8a10a718ffae6089efcf3749cbcf6008 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sun, 3 Apr 2022 13:27:31 +0100 Subject: [PATCH] Fix a negative shift exponent sanitizer warning Source/spells.h:53:14: runtime error: shift exponent -1 is negative Fixes #4319 --- Source/controls/modifier_hints.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/controls/modifier_hints.cpp b/Source/controls/modifier_hints.cpp index 5e54f075d..acf15e811 100644 --- a/Source/controls/modifier_hints.cpp +++ b/Source/controls/modifier_hints.cpp @@ -130,7 +130,7 @@ void DrawSpellsCircleMenuHint(const Surface &out, const Point &origin) for (int slot = 0; slot < 4; ++slot) { splId = myPlayer._pSplHotKey[slot]; - if (splId != SPL_INVALID && (spells & GetSpellBitmask(splId)) != 0) + if (splId != SPL_INVALID && splId != SPL_NULL && (spells & GetSpellBitmask(splId)) != 0) splType = (currlevel == 0 && !spelldata[splId].sTownSpell) ? RSPLTYPE_INVALID : myPlayer._pSplTHotKey[slot]; else { splType = RSPLTYPE_INVALID;