From 66047223717d0e7d4a8ea708d485dc1b01ac0f9b Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Thu, 9 Jan 2020 21:25:04 +0100 Subject: [PATCH] warn about unsupported node formats and exit gracefully --- Source/p_setup.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Source/p_setup.c b/Source/p_setup.c index fdbc3a44..39981fba 100644 --- a/Source/p_setup.c +++ b/Source/p_setup.c @@ -282,6 +282,20 @@ void P_LoadNodes (int lump) nodes = Z_Malloc (numnodes*sizeof(node_t),PU_LEVEL,0); data = W_CacheLumpNum (lump, PU_STATIC); + // [FG] warn about unsupported node formats and exit gracefully + if (W_LumpLength(lump) >= 8) + { + if (!memcmp(data, "xNd4\0\0\0\0", 8) || + !memcmp(data, "XNOD", 4) || + !memcmp(data, "ZNOD", 4)) + { + char fmt[5]; + memcpy(fmt, data, 4); + fmt[4] = '\0'; + I_Error("Unsupported nodes format: %s\n", fmt); + } + } + for (i=0; i