mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Check that colour slot is non-empty before checking for gray-ness
This is otherwise UB, and trips a GLIBCXX assertion (when enabled).
This commit is contained in:
@@ -142,7 +142,7 @@ public:
|
||||
}
|
||||
uint8_t bins = 0;
|
||||
for (auto const &color : colors) {
|
||||
if (color->isTransparent()) {
|
||||
if (!color.has_value() || color->isTransparent()) {
|
||||
continue;
|
||||
}
|
||||
if (!color->isGray()) {
|
||||
|
||||
Reference in New Issue
Block a user