mirror of
https://github.com/gbdev/rgbds.git
synced 2026-08-22 06:44:33 +00:00
Fix crash on image without any colors (all transparent)
This commit is contained in:
@@ -377,6 +377,7 @@ static std::pair<std::vector<size_t>, std::vector<Palette>>
|
||||
pal.addColor(color);
|
||||
}
|
||||
}
|
||||
assume(!palettes.empty());
|
||||
|
||||
// "Sort" colors in the generated palettes, see the man page for the flowchart
|
||||
if (options.palSpecType == Options::DMG) {
|
||||
@@ -1150,6 +1151,10 @@ continue_visiting_tiles:;
|
||||
}
|
||||
// LCOV_EXCL_STOP
|
||||
|
||||
if (colorSets.empty()) {
|
||||
fatal("Image does not contain any colors");
|
||||
}
|
||||
|
||||
if (options.palSpecType == Options::EMBEDDED) {
|
||||
generatePalSpec(image);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user