From 723e3381baf49d8b382366acb7843fe8a8108206 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Tue, 24 Jan 2023 20:27:38 +0100 Subject: [PATCH] lv-tool: Fix check for a suitable palette We can only copy 256 entries if we have them... --- libvisual/tools/lv-tool/lv-tool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvisual/tools/lv-tool/lv-tool.cpp b/libvisual/tools/lv-tool/lv-tool.cpp index ee7140a11..c17e01751 100644 --- a/libvisual/tools/lv-tool/lv-tool.cpp +++ b/libvisual/tools/lv-tool/lv-tool.cpp @@ -401,7 +401,7 @@ namespace { visual_log_return_if_fail( m_screen_video != nullptr ); VisPalette * const pal = m_screen_video->pal; - if (pal != nullptr && pal->ncolors <= 256) { + if (pal != nullptr && pal->ncolors >= 256) { SDL_Color colors[256]; for (int i = 0; i < 256; i++) {