Precache: fix off by one, making the precache code write into memory it should not be touching

This commit is contained in:
Alam Ed Arias 2016-05-09 20:10:14 -04:00
parent d9298edec1
commit be0c062c5b

View file

@ -1604,7 +1604,7 @@ void R_PrecacheLevel(void)
//
// no need to precache all software textures in 3D mode
// (note they are still used with the reference software view)
texturepresent = calloc(numtextures, sizeof (*texturepresent));
texturepresent = calloc(numtextures+1, sizeof (*texturepresent));
if (texturepresent == NULL) I_Error("%s: Out of memory looking up textures", "R_PrecacheLevel");
for (j = 0; j < numsides; j++)