From c833d73e3225df5f27b6905383d3b8087c66a22a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Sat, 5 Oct 2024 11:28:03 +0200 Subject: [PATCH] Fix potential segfault when flat images has changed on netcode --- src/p_saveg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index aad7351f0..d6f8d23c5 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -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);