From b8e862cbd7d18ea8bda3f7b3bc2e57c0fa0d5d04 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Tue, 23 Oct 2007 14:15:27 +0000 Subject: [PATCH] when resizing, don't advance the "data" pointer of regions of contiguous 2007-10-23 Michael Natterer * app/base/pixel-region.c (pixel_region_resize): when resizing, don't advance the "data" pointer of regions of contiguous data. I should have made this change along with my pixel region cleanup of 2005-09-03 which sanitized pixel regions of contiguous data. Fixes bug #489229. * libgimp/gimppixelrgn.c (gimp_pixel_rgn_resize): remove the same code here (the removed code was dead since this function refuses to be called on pixel regions without a drawable). svn path=/trunk/; revision=23922 --- ChangeLog | 12 ++++++++++++ app/base/pixel-region.c | 6 ------ libgimp/gimppixelrgn.c | 6 ------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 36d464ca3a..58ed90c324 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2007-10-23 Michael Natterer + + * app/base/pixel-region.c (pixel_region_resize): when resizing, + don't advance the "data" pointer of regions of contiguous data. I + should have made this change along with my pixel region cleanup of + 2005-09-03 which sanitized pixel regions of contiguous data. + Fixes bug #489229. + + * libgimp/gimppixelrgn.c (gimp_pixel_rgn_resize): remove the same + code here (the removed code was dead since this function refuses + to be called on pixel regions without a drawable). + 2007-10-23 Sven Neumann * app/core/gimpdrawable-combine.c: formatting. diff --git a/app/base/pixel-region.c b/app/base/pixel-region.c index 825f206246..ad2a757d51 100644 --- a/app/base/pixel-region.c +++ b/app/base/pixel-region.c @@ -123,12 +123,6 @@ pixel_region_resize (PixelRegion *PR, gint w, gint h) { - /* If the data is non-null, data is contiguous--need to advance */ - if (PR->data != NULL) - PR->data += ((y - PR->y) * PR->rowstride + - (x - PR->x) * PR->bytes); - - /* update sizes for both contiguous and tiled regions */ PR->x = x; PR->y = y; PR->w = w; diff --git a/libgimp/gimppixelrgn.c b/libgimp/gimppixelrgn.c index 9a5967a321..d42c7ed613 100644 --- a/libgimp/gimppixelrgn.c +++ b/libgimp/gimppixelrgn.c @@ -159,12 +159,6 @@ gimp_pixel_rgn_resize (GimpPixelRgn *pr, g_return_if_fail (x >= 0 && x + width <= pr->drawable->width); g_return_if_fail (y >= 0 && y + height <= pr->drawable->height); - /* If the data is non-null, data is contiguous--need to advance */ - if (pr->data != NULL) - pr->data += ((y - pr->y) * pr->rowstride + - (x - pr->x) * pr->bpp); - - /* update sizes for both contiguous and tiled regions */ pr->x = x; pr->y = y; pr->w = width;