Merge branch 'EOFEndsDefinition' into 'master'

Fix off-by-one error in BRIGHT and TERRAIN lump parsing

See merge request KartKrew/RingRacers!35
This commit is contained in:
Sal 2024-08-09 04:25:05 +00:00
commit 5d7f74299d
2 changed files with 12 additions and 12 deletions

View file

@ -112,7 +112,7 @@ static boolean K_BRIGHTLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
brightmapStorage_t *bms = K_GetBrightmapStorageByTextureName(tkn);
@ -127,7 +127,7 @@ static boolean K_BRIGHTLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
strncpy(bms->brightmapName, tkn, 8);
bms->brightmapHash = quickncasehash(tkn, 8);

View file

@ -1823,7 +1823,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
t_splash_t *s = NULL;
@ -1864,7 +1864,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
t_footstep_t *fs = NULL;
@ -1905,7 +1905,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
t_overlay_t *o = NULL;
@ -1946,7 +1946,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
terrain_t *t = NULL;
@ -1986,8 +1986,8 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
Z_Free(tkn);
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
if (stricmp(tkn, "optional") == 0)
{
@ -1998,7 +1998,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
pos = M_GetTokenPos();
}
if (tkn && pos < size)
if (tkn && pos <= size)
{
t_floor_t *f = NULL;
@ -2027,7 +2027,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
terrain_t *t = K_GetTerrainByName(tkn);
@ -2072,7 +2072,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
terrain_t *t = NULL;
@ -2111,7 +2111,7 @@ static boolean K_TERRAINLumpParser(char *data, size_t size)
tkn = M_GetToken(NULL);
pos = M_GetTokenPos();
if (tkn && pos < size)
if (tkn && pos <= size)
{
t_footstep_t *fs = NULL;