From d6c0e0cf30d59f954871c957da9c14671c881970 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Mon, 19 Oct 2020 20:20:08 -0400 Subject: [PATCH] Fix G_GhostTicker crashing trying to read netvars as ghost data Also fixed possible issue with incorrectly reading the demo pointer due to the wrong type being passed to sizeof in G_ConsGhostTic --- src/g_demo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_demo.c b/src/g_demo.c index e45f23b62..0f72ad109 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -625,7 +625,7 @@ void G_ConsGhostTic(void) if (followtic & FZT_SCALE) demo_p += sizeof(fixed_t); // momx, momy and momz - demo_p += (demoversion < 0x000e) ? sizeof(UINT16) * 3 : sizeof(fixed_t) * 3; + demo_p += (demoversion < 0x000e) ? sizeof(INT16) * 3 : sizeof(fixed_t) * 3; if (followtic & FZT_SKIN) demo_p++; demo_p += sizeof(UINT16); @@ -2163,7 +2163,7 @@ void G_AddGhost(char *defdemoname) count = READUINT16(p); while (count--) { - p += 2; + SKIPSTRING(p); SKIPSTRING(p); p++; }