Implement max palette count

This commit is contained in:
ISSOtm
2022-03-12 17:19:54 +01:00
committed by Eldred Habert
parent d2f9cc7e8c
commit 943d631701
2 changed files with 6 additions and 1 deletions

View File

@@ -937,6 +937,11 @@ contained:;
}
}
if (palettes.size() > options.nbPalettes) {
// If the palette generation is wrong, other (dependee) operations are likely to be nonsensical, so fatal-error outright
fatal("Generated %zu palettes, over the maximum of %" PRIu8, palettes.size(), options.nbPalettes);
}
if (!options.palettes.empty()) {
outputPalettes(palettes);
}

View File

@@ -333,7 +333,7 @@ int main(int argc, char *argv[]) {
}
break;
case 'n':
options.nbPalettes = 0; // TODO
options.nbPalettes = parseNumber(arg, "Number of palettes", 8);
break;
case 'o':
options.output = musl_optarg;