summaryrefslogtreecommitdiff
path: root/packages/cairo/cairo-1.4.14/0001-Fix-for-a-memory-leak-in-pixman.patch
diff options
context:
space:
mode:
authorPaul Sokolovsky <pmiscml@gmail.com>2008-02-16 03:02:34 +0000
committerPaul Sokolovsky <pmiscml@gmail.com>2008-02-16 03:02:34 +0000
commitb07c4c56e17999d26811b21cd26895e74bd93b40 (patch)
treed5dc3868bad7098a4057fb0e80675e6aff84a589 /packages/cairo/cairo-1.4.14/0001-Fix-for-a-memory-leak-in-pixman.patch
parentf53ea006bcf4e938ed1c569080472dd05dc84b4d (diff)
parent4ad71912603efd65137867c9767428a9ff8b239a (diff)
merge of '6453c1938bbcd0ab830b8bc186e501a3ec4ebb10'
and 'a635d59f6f07065e2f3d4b3de4e72a4a2e442be3'
Diffstat (limited to 'packages/cairo/cairo-1.4.14/0001-Fix-for-a-memory-leak-in-pixman.patch')
-rw-r--r--packages/cairo/cairo-1.4.14/0001-Fix-for-a-memory-leak-in-pixman.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/packages/cairo/cairo-1.4.14/0001-Fix-for-a-memory-leak-in-pixman.patch b/packages/cairo/cairo-1.4.14/0001-Fix-for-a-memory-leak-in-pixman.patch
new file mode 100644
index 0000000000..686ab7ceb0
--- /dev/null
+++ b/packages/cairo/cairo-1.4.14/0001-Fix-for-a-memory-leak-in-pixman.patch
@@ -0,0 +1,32 @@
+From 7647f29a2a3b69592e38f50890a96d8deeaa2dbb Mon Sep 17 00:00:00 2001
+From: Jan Slupski <jslupski@juljas.net>
+Date: Fri, 15 Feb 2008 00:55:30 +0100
+Subject: [PATCH] Fix for a memory leak in pixman.
+
+Port of a 1.6 fix for a memory leak in pixman_region_init_rects/pixman_rect_alloc
+when the count of boxes is 0.
+---
+ pixman/src/pixregion.c | 9 +++++++++
+ 1 files changed, 9 insertions(+), 0 deletions(-)
+
+diff --git a/pixman/src/pixregion.c b/pixman/src/pixregion.c
+index 1ed3ad7..d6caf6c 100644
+--- a/pixman/src/pixregion.c
++++ b/pixman/src/pixregion.c
+@@ -355,6 +355,15 @@ pixman_region_init_rects(pixman_region16_t *region, pixman_box16_t *boxes, int c
+ }
+
+ pixman_region_init(region);
++
++ /* if it's 0, don't call pixman_rect_alloc -- 0 rectangles is
++ * a special case, and causing pixman_rect_alloc would cause
++ * us to leak memory (because the 0-rect case should be the
++ * static pixman_region_emptyData data).
++ */
++ if (count == 0)
++ return PIXMAN_REGION_STATUS_SUCCESS;
++
+ if (!pixman_rect_alloc(region, count))
+ return PIXMAN_REGION_STATUS_FAILURE;
+
+