mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-19 06:14:03 +00:00
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:
parent
d88c0e906c
commit
ef798bbcc3
|
@ -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.
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue