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 committed 2016-05-09 20:10:14 -04:00
1 parent d9298edec1
commit be0c062c5b
1 file changed
+1 -1
+1 -1
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++)