imglib: error if trying to use a palette but none is loaded

This commit is contained in:
Eric Wasylishen 2025-01-28 21:43:03 -07:00
parent c06dbb0693
commit 21a665110c
1 changed files with 3 additions and 0 deletions

View File

@ -99,6 +99,9 @@ void init_palette(const gamedef_t *game)
static void convert_paletted_to_32_bit(
const std::vector<uint8_t> &pixels, std::vector<qvec4b> &output, const std::vector<qvec3b> &pal)
{
if (pal.size() != 256) {
FError("palette size {} != 256", pal.size());
}
output.resize(pixels.size());
for (size_t i = 0; i < pixels.size(); i++) {