Commit 8cd676ed authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

check tile != NULL before unrefing it. Fixes bug #140554; merged from

2004-04-20  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/iwarp.c (iwarp_get_pixel): check tile != NULL
	before unrefing it. Fixes bug #140554; merged from stable branch.
parent 8339ba7f
2004-04-20 Sven Neumann <sven@gimp.org>
* plug-ins/common/iwarp.c (iwarp_get_pixel): check tile != NULL
before unrefing it. Fixes bug #140554; merged from stable branch.
2004-04-20 Sven Neumann <sven@gimp.org>
* app/widgets/gimpenumcombobox.c: added more sanity checks.
......
......@@ -229,7 +229,7 @@ static gboolean do_animate_ping_pong = FALSE;
static gdouble supersample_threshold_2;
static gint xl, yl, xh, yh;
static gint tile_width, tile_height;
static GimpTile *tile = NULL;
static GimpTile *tile = NULL;
static gdouble pre2img, img2pre;
static gint preview_bpp;
static gdouble animate_deform_value = 1.0;
......@@ -345,18 +345,22 @@ iwarp_get_pixel (gint x,
{
col = x / tile_width;
row = y / tile_height;
if (col != old_col || row != old_row)
{
gimp_tile_unref (tile, FALSE);
if (tile)
gimp_tile_unref (tile, FALSE);
tile = gimp_drawable_get_tile (drawable, FALSE, row, col);
gimp_tile_ref (tile);
old_col = col;
old_row = row;
}
data =
tile->data +
(tile->ewidth * (y % tile_height) +
x % tile_width) * image_bpp;
data = tile->data + (tile->ewidth * (y % tile_height) +
x % tile_width) * image_bpp;
for (i = 0; i < image_bpp; i++)
*pixel++ = *data++;
}
......@@ -825,7 +829,8 @@ iwarp (void)
animate_deform_value = 1.0;
iwarp_frame ();
}
if (tile != NULL)
if (tile)
{
gimp_tile_unref (tile, FALSE);
tile = NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment