From f76b79ae26999196596ec453e04304ec320e83ab Mon Sep 17 00:00:00 2001 From: William Skaggs Date: Sun, 20 Mar 2005 20:01:55 +0000 Subject: [PATCH] Bill Skaggs * app/core/gimpimage-convert.c: check for non-empty palette before converting to indexed using custom palette, otherwise show warning and abort; fixes bug #170973. --- ChangeLog | 6 ++++++ app/core/gimpimage-convert.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3dba7bd20f..c3b7b7793b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-03-20 Bill Skaggs + + * app/core/gimpimage-convert.c: check for non-empty palette + before converting to indexed using custom palette, otherwise + show warning and abort; fixes bug #170973. + 2005-03-20 Bill Skaggs * app/core/gimpimage-convert.c: applied patch from Adam diff --git a/app/core/gimpimage-convert.c b/app/core/gimpimage-convert.c index 8d166c57a2..426833bec2 100644 --- a/app/core/gimpimage-convert.c +++ b/app/core/gimpimage-convert.c @@ -798,6 +798,13 @@ gimp_image_convert (GimpImage *gimage, g_return_if_fail (new_type != gimp_image_base_type (gimage)); g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress)); + if (palette_type == GIMP_CUSTOM_PALETTE) + if (! custom_palette || ! custom_palette->n_colors) + { + g_message (_("Cannot convert image, palette is empty")); + return; + } + theCustomPalette = custom_palette; gimp_set_busy (gimage->gimp);