Permalink
Browse files

2008-08-11 Sebastien Pouliot <sebastien@ximian.com>

	* image.c: Remove buggy loop in gdip_bitmap_clone which allocates way
	too much memory when cloning an image with multiple frames (and only
	free one of them).
	[Fix bug #411454]
	[Backport r110129]


svn path=/branches/mono-2-0/libgdiplus/; revision=110130
  • Loading branch information...
1 parent 606e6ab commit 959464e87e2044e5c62870e65608ebce8ab73cc6 Sebastien Pouliot committed Aug 11, 2008
Showing with 11 additions and 6 deletions.
  1. +8 −0 src/ChangeLog
  2. +3 −6 src/bitmap.c
View
8 src/ChangeLog
@@ -1,3 +1,11 @@
+2008-08-11 Sebastien Pouliot <sebastien@ximian.com>
+
+ * image.c: Remove buggy loop in gdip_bitmap_clone which allocates way
+ too much memory when cloning an image with multiple frames (and only
+ free one of them).
+ [Fix bug #411454]
+ [Backport r110129]
+
2008-08-04 Sebastien Pouliot <sebastien@ximian.com>
* graphics-cairo.c: (make_arcs) Simplify logic so the increment is
View
9 src/bitmap.c
@@ -652,12 +652,9 @@ gdip_bitmap_clone (GpBitmap *bitmap, GpBitmap **clonedbitmap)
result->frames[frame].frame_dimension = bitmap->frames[frame].frame_dimension;
result->frames[frame].bitmap = NULL;
- for (image = 0; image < bitmap->frames[frame].count; image++) {
- status = gdip_bitmapdata_clone(bitmap->frames[frame].bitmap, &result->frames[frame].bitmap, bitmap->frames[frame].count);
- if (status != Ok) {
- goto fail;
- }
- }
+ status = gdip_bitmapdata_clone (bitmap->frames[frame].bitmap, &result->frames[frame].bitmap, bitmap->frames[frame].count);
+ if (status != Ok)
+ goto fail;
}
result->active_bitmap = &result->frames[result->active_frame].bitmap[result->active_bitmap_no];
} else {

0 comments on commit 959464e

Please sign in to comment.