diff --git a/Quake/r_brush.c b/Quake/r_brush.c index 991d2ab9..14999089 100644 --- a/Quake/r_brush.c +++ b/Quake/r_brush.c @@ -726,6 +726,8 @@ int AllocBlock (int w, int h, int *x, int *y) lightmap_count++; lightmap = (struct lightmap_s *) realloc(lightmap, sizeof(*lightmap)*lightmap_count); memset(&lightmap[texnum], 0, sizeof(lightmap[texnum])); + /* FIXME: we leave 'gaps' in malloc()ed data, CRC_Block() later accesses + * that uninitialized data and valgrind complains for it. use calloc() ? */ lightmap[texnum].data = (byte *) malloc(4*LMBLOCK_WIDTH*LMBLOCK_HEIGHT); //as we're only tracking one texture, we don't need multiple copies of allocated any more. memset(allocated, 0, sizeof(allocated));