[PATCH] Fix models causing an overflow

This commit is contained in:
NepDisk 2025-05-27 13:43:32 -04:00
parent c348dbdd08
commit 705c4530af

View file

@ -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)