Merge branch 'fix-floorpic-segfault' into 'next'

Fix potential segfault when flat images has changed on netcode

See merge request STJr/SRB2!2527
This commit is contained in:
Lactozilla 2024-10-07 19:24:44 +00:00
commit 64d84ec491

View file

@ -1501,13 +1501,13 @@ static void UnArchiveSectors(save_t *save_p)
sectors[i].ceilingheight = P_ReadFixed(save_p);
if (diff & SD_FLOORPIC)
{
sectors[i].floorpic = P_AddLevelFlatRuntime((char *)save_p);
save_p += 8;
sectors[i].floorpic = P_AddLevelFlatRuntime((char *)&save_p->buf[save_p->pos]);
save_p->pos += 8;
}
if (diff & SD_CEILPIC)
{
sectors[i].ceilingpic = P_AddLevelFlatRuntime((char *)save_p);
save_p += 8;
sectors[i].ceilingpic = P_AddLevelFlatRuntime((char *)&save_p->buf[save_p->pos]);
save_p->pos += 8;
}
if (diff & SD_LIGHT)
sectors[i].lightlevel = P_ReadINT16(save_p);