handle an empty colormap. Fixes bug #143009.

2004-05-27  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/png.c (respin_cmap): handle an empty colormap.
	Fixes bug #143009.
This commit is contained in:
Sven Neumann 2004-05-27 15:23:56 +00:00 committed by Sven Neumann
parent 9c2ac01ec2
commit a5269a0d00
2 changed files with 21 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2004-05-27 Sven Neumann <sven@gimp.org>
* plug-ins/common/png.c (respin_cmap): handle an empty colormap.
Fixes bug #143009.
2004-05-27 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimppickbutton.c: applied patch from Philip

View File

@ -1471,15 +1471,25 @@ respin_cmap (png_structp pp,
GimpDrawable * drawable)
{
static const guchar trans[] = { 0 };
gint colors;
guchar *before;
gint transparent;
gint cols, rows;
GimpPixelRgn pixel_rgn;
guchar *pixels;
gint colors;
guchar *before;
gint transparent;
gint cols, rows;
GimpPixelRgn pixel_rgn;
guchar *pixels;
before = gimp_image_get_cmap (image_ID, &colors);
/*
* Make sure there is something in the colormap.
*/
if (colors == 0)
{
before = g_new0 (guchar, 3);
colors = 1;
}
cols = drawable->width;
rows = drawable->height;