From 361c66d06ae035363664c2d633037f359f9102a6 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Wed, 20 Nov 2019 02:47:04 +0000 Subject: [PATCH] Reject lit files if they're the wrong size (eg hipnotic/start.bsp vs id1/start.lit or just a bsp that no longer has any coloured lits, etc). From Spike. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1654 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/gl_model.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Quake/gl_model.c b/Quake/gl_model.c index e6cda6b3..8f2e67a1 100644 --- a/Quake/gl_model.c +++ b/Quake/gl_model.c @@ -731,9 +731,14 @@ void Mod_LoadLighting (lump_t *l) i = LittleLong(((int *)data)[1]); if (i == 1) { - Con_DPrintf2("%s loaded\n", litfilename); - loadmodel->lightdata = data + 8; - return; + if (8+l->filelen*3 == com_filesize) + { + Con_DPrintf2("%s loaded\n", litfilename); + loadmodel->lightdata = data + 8; + return; + } + Hunk_FreeToLowMark(mark); + Con_Printf("Outdated .lit file (%s should be %u bytes, not %u)\n", litfilename, 8+l->filelen*3, com_filesize); } else {