diff --git a/app/core/gimpimage-colormap.c b/app/core/gimpimage-colormap.c index 1197a9735a..d4a322ed21 100644 --- a/app/core/gimpimage-colormap.c +++ b/app/core/gimpimage-colormap.c @@ -162,8 +162,6 @@ gimp_image_colormap_update_formats (GimpImage *image) &private->babl_palette_rgba); format = gimp_babl_format (GIMP_RGB, private->precision, FALSE, space), - gimp_palette_restrict_format (private->palette, format, FALSE); - g_free (format_name); if (private->palette && gimp_palette_get_n_colors (private->palette) > 0) @@ -171,6 +169,8 @@ gimp_image_colormap_update_formats (GimpImage *image) guchar *colormap; gint n_colors; + gimp_palette_restrict_format (private->palette, format, FALSE); + colormap = _gimp_image_get_colormap (image, &n_colors); g_return_if_fail (colormap != NULL);