From e21ff01946c425b345abd8c0910864eaa61a6848 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 25 May 2014 16:10:01 -0500 Subject: [PATCH] Don't use memset with non-zero value to fill ints Coverity reported using value -2 as a bad memset. Really doesn't make sense when filling ints and not bytes too. --- code/renderergl2/tr_model.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/renderergl2/tr_model.c b/code/renderergl2/tr_model.c index f2f55425..b385dee6 100644 --- a/code/renderergl2/tr_model.c +++ b/code/renderergl2/tr_model.c @@ -1132,6 +1132,7 @@ static qboolean R_LoadMDR( model_t *mod, void *buffer, int filesize, const char ** RE_BeginRegistration */ void RE_BeginRegistration( glconfig_t *glconfigOut ) { + int i; R_Init(); @@ -1140,7 +1141,10 @@ void RE_BeginRegistration( glconfig_t *glconfigOut ) { R_IssuePendingRenderCommands(); tr.visIndex = 0; - memset(tr.visClusters, -2, sizeof(tr.visClusters)); // force markleafs to regenerate + // force markleafs to regenerate + for(i = 0; i < MAX_VISCOUNTS; i++) { + tr.visClusters[i] = -2; + } R_ClearFlares(); RE_ClearScene();