diff --git a/ruamoko/qwaq/builtins/graphics.c b/ruamoko/qwaq/builtins/graphics.c index e31aa1d27..1f408344c 100644 --- a/ruamoko/qwaq/builtins/graphics.c +++ b/ruamoko/qwaq/builtins/graphics.c @@ -303,7 +303,10 @@ generate_colormap (void) memcpy (colors[i][224], colors[31][224], 32 * 3); } 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); }