return NULL tiles if the matrix would transform the drawable into nothing.

2004-03-26  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable-transform.c
	(gimp_drawable_transform_tiles_affine): return NULL tiles if the
	matrix would transform the drawable into nothing. Fixes the
	core-crashing part of bug #138117 and makes the script fail
	with an execution error.
This commit is contained in:
Michael Natterer 2004-03-26 10:28:44 +00:00 committed by Michael Natterer
parent d88c0e906c
commit ef798bbcc3
3 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,11 @@
2004-03-26 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable-transform.c
(gimp_drawable_transform_tiles_affine): return NULL tiles if the
matrix would transform the drawable into nothing. Fixes the
core-crashing part of bug #138117 and makes the script fail
with an execution error.
2004-03-25 Sven Neumann <sven@gimp.org>
* README: mention the gimp-perl pre-release and provide a link.

View file

@ -231,6 +231,10 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
y2 = RINT (MAX4 (dy1, dy2, dy3, dy4));
}
/* Check if the matrix transforms the tiles into nothing */
if ((x2 - x1) < 1 || (y2 - y1) < 1)
return NULL;
/* Get the new temporary buffer for the transformed result */
new_tiles = tile_manager_new (x2 - x1, y2 - y1,
tile_manager_bpp (orig_tiles));

View file

@ -231,6 +231,10 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
y2 = RINT (MAX4 (dy1, dy2, dy3, dy4));
}
/* Check if the matrix transforms the tiles into nothing */
if ((x2 - x1) < 1 || (y2 - y1) < 1)
return NULL;
/* Get the new temporary buffer for the transformed result */
new_tiles = tile_manager_new (x2 - x1, y2 - y1,
tile_manager_bpp (orig_tiles));