[ruamoko] Avoid copying a block of memory to itself

Not a big deal, but valgrind didn't like it.
This commit is contained in:
Bill Currie 2023-03-28 13:21:57 +09:00
parent 9317ce7358
commit 451a98d391

View file

@ -313,8 +313,10 @@ generate_colormap (void)
} }
} }
} }
// fullbrights // fullbrights, but avoid copying the source row to itself
memcpy (colors[i][224], colors[31][224], 32 * 3); if (i != 31) {
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]);
// the colormap has an extra byte indicating the number of fullbright // the colormap has an extra byte indicating the number of fullbright