From 12ba057b4f74a6ef4989d0ceb4075ef74bcc6ea2 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Tue, 11 Oct 2022 21:39:32 +0200 Subject: [PATCH] Check that colour slot is non-empty before checking for gray-ness This is otherwise UB, and trips a GLIBCXX assertion (when enabled). --- src/gfx/process.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gfx/process.cpp b/src/gfx/process.cpp index d19dc72c..8b0ec650 100644 --- a/src/gfx/process.cpp +++ b/src/gfx/process.cpp @@ -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()) {