mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
[qwaq] Copy only those bytes in the colormap tex
The fullbright count byte in a colormap is not in the generated colormap texture data. Attempting to read it results in an angry valgrind.
This commit is contained in:
parent
3147443617
commit
a1813868fc
1 changed files with 4 additions and 1 deletions
|
@ -303,7 +303,10 @@ generate_colormap (void)
|
||||||
memcpy (colors[i][224], colors[31][224], 32 * 3);
|
memcpy (colors[i][224], colors[31][224], 32 * 3);
|
||||||
}
|
}
|
||||||
tex_t *cmap = ConvertImage (&tex, default_palette[0]);
|
tex_t *cmap = ConvertImage (&tex, default_palette[0]);
|
||||||
memcpy (default_colormap, cmap->data, sizeof (default_colormap));
|
// the colormap has an extra byte indicating the number of fullbright
|
||||||
|
// entries, but that byte is not in the image, so don't try to copy it,
|
||||||
|
// thus the - 1
|
||||||
|
memcpy (default_colormap, cmap->data, sizeof (default_colormap) - 1);
|
||||||
free (cmap);
|
free (cmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue