avoid crashing when the widget allocation is small (bug #511926).

2008-01-25  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpcolormapeditor.c (gimp_colormap_editor_draw):
	avoid crashing when the widget allocation is small (bug 
#511926).


svn path=/trunk/; revision=24704
This commit is contained in:
Sven Neumann 2008-01-25 07:39:33 +00:00 committed by Sven Neumann
parent 60089b643d
commit 4624bc84d4
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2008-01-25 Sven Neumann <sven@gimp.org>
* app/widgets/gimpcolormapeditor.c (gimp_colormap_editor_draw):
avoid crashing when the widget allocation is small (bug #511926).
2008-01-24 Sven Neumann <sven@gimp.org>
* app/about.h (GIMP_COPYRIGHT): updated copyright.

View File

@ -504,7 +504,8 @@ gimp_colormap_editor_draw (GimpColormapEditor *editor)
row[(j * cellsize + k) * 3 + b] = image->colormap[col * 3 + b];
}
memset (row + j * cellsize * 3, 255, 3 * (width - j * cellsize));
if (j * cellsize > width)
memset (row + j * cellsize * 3, 255, 3 * (width - j * cellsize));
for (k = 0; k < cellsize; k++)
{