From 705c4530af94abb84b1d1795b5d2126b7143cbf4 Mon Sep 17 00:00:00 2001 From: NepDisk Date: Tue, 27 May 2025 13:43:32 -0400 Subject: [PATCH] [PATCH] Fix models causing an overflow --- src/hardware/hw_md2.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 013b2fb39..bfe07603b 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -599,7 +599,10 @@ modelfound: void HWR_AddPlayerModel(int skin) // For skins that were added after startup { FILE *f; - char name[24], filename[32]; + char name[26], filename[32]; + // name[24] is used to check for names in the models.dat file that match with sprites or player skins + // sprite names are always 4 characters long, and names is for player skins can be up to 19 characters long + // PLAYERMODELPREFIX is 6 characters long float scale, offset; size_t prefixlen; @@ -655,10 +658,12 @@ playermodelfound: void HWR_AddSpriteModel(size_t spritenum) // For sprites that were added after startup { FILE *f; + + char name[26], filename[32]; // name[24] is used to check for names in the models.dat file that match with sprites or player skins // sprite names are always 4 characters long, and names is for player skins can be up to 19 characters long // PLAYERMODELPREFIX is 6 characters long - char name[24], filename[32]; + float scale, offset; if (nomd2s)