From f74980027613ade10f50fa4c4dfa9ad81e9fde28 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 22 Oct 2025 15:33:09 +0200 Subject: [PATCH] fix playersetup skin speen reading out of bounds reported by ubsan --- src/m_menu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 6822dd499..e9915cb9c 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8279,12 +8279,12 @@ static void M_DrawSetupMultiPlayerMenu(void) sprframe = &sprdef->spriteframes[frame]; - //minenice's speen css, it's a piece of shit but hey + // minenice's speen css, it's a piece of shit but hey speenframe = (I_GetTime()*cv_skinselectspin.value/TICRATE + 1)%8; - //this is a very shitty solution for checking if a sprite needs flipping - //but it works - if ((sprframe->lumppat[speenframe] == sprframe->lumppat[8-speenframe]) && (speenframe > 4)) + // this is a very shitty solution for checking if a sprite needs flipping + // but it works + if ((speenframe > 4) && (sprframe->lumppat[speenframe] == sprframe->lumppat[8-speenframe])) flags = V_FLIP; // This sprite is left/right flipped! patch = (patch_t *)W_CachePatchNum(sprframe->lumppat[speenframe], PU_PATCH);