From a597d9b4636d575af110bd0fdd6b2c2c1619f74d Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 15 Feb 2021 16:37:37 +0000 Subject: [PATCH] Fixed a too-small memory allocation for Encore remaps, removing all memory-related crashes in Software. --- src/r_data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_data.c b/src/r_data.c index 39c41d8bf..851e0cd93 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -731,7 +731,7 @@ lighttable_t *R_CreateLightTable(extracolormap_t *extra_colormap) // Now allocate memory for the actual colormap array itself! // aligned on 8 bit for asm code - colormap_p = Z_MallocAlign((256 * 34) + 10, PU_LEVEL, NULL, 8); + colormap_p = Z_MallocAlign((256 * (encoremap ? 64 : 32)) + 10, PU_LEVEL, NULL, 8); lighttable = (UINT8 *)colormap_p; // Calculate the palette index for each palette index, for each light level