app/gegl/gimpoperationposterize.c don't crash if there is no config

2008-02-06  Michael Natterer  <mitch@gimp.org>

	* app/gegl/gimpoperationposterize.c
	* app/gegl/gimpoperationhuesaturation.c (process): don't crash if
	there is no config object.


svn path=/trunk/; revision=24821
This commit is contained in:
Michael Natterer 2008-02-06 15:08:18 +00:00 committed by Michael Natterer
parent a86a237fdc
commit ce99c14bae
2 changed files with 6 additions and 4 deletions

View File

@ -1,8 +1,8 @@
2008-02-06 Michael Natterer <mitch@gimp.org>
* app/gegl/gimpoperationhuesaturation.c
(gimp_operation_hue_saturation_process): don't crash if there is
no config object.
* app/gegl/gimpoperationposterize.c
* app/gegl/gimpoperationhuesaturation.c (process): don't crash if
there is no config object.
2008-02-06 Michael Natterer <mitch@gimp.org>

View File

@ -83,11 +83,13 @@ gimp_operation_posterize_process (GeglOperation *operation,
GimpPosterizeConfig *config = GIMP_POSTERIZE_CONFIG (point->config);
gfloat *src = in_buf;
gfloat *dest = out_buf;
gfloat levels = config->levels - 1.0;
gfloat levels;
if (! config)
return FALSE;
levels = config->levels - 1.0;
while (samples--)
{
dest[RED_PIX] = RINT (src[RED_PIX] * levels) / levels;