summaryrefslogtreecommitdiff
path: root/extra/xf86-video-intel/0005-uxa-Fix-leak-of-glyph-mask-for-unhandled-glyph-compo.patch
blob: 8656790788d0d8d2d276d8145868ffcc2c5af900 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From af5c698fd43308c3b799783b662b9cd871f90a62 Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sat, 14 Apr 2012 19:03:25 +0100
Subject: [PATCH 5/5] uxa: Fix leak of glyph mask for unhandled glyph
 composition

==1401== 7,344 bytes in 34 blocks are possibly lost in loss record 570 of 587
==1401==    at 0x4027034: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1401==    by 0x8BE5150: drm_intel_gem_bo_alloc_internal (intel_bufmgr_gem.c:689)
==1401==    by 0x899FC04: intel_uxa_create_pixmap (intel_uxa.c:1077)
==1401==    by 0x89C2C41: uxa_glyphs (uxa-glyphs.c:254)
==1401==    by 0x21F05E: damageGlyphs (damage.c:647)
==1401==    by 0x218E06: ProcRenderCompositeGlyphs (render.c:1434)
==1401==    by 0x15AA40: Dispatch (dispatch.c:439)
==1401==    by 0x1499E9: main (main.c:287)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 uxa/uxa-glyphs.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c
index b754f4e..921b99c 100644
--- a/uxa/uxa-glyphs.c
+++ b/uxa/uxa-glyphs.c
@@ -812,8 +812,10 @@ uxa_glyphs_via_mask(CARD8 op,
 				if (!uxa_pixmap_is_offscreen(src_pixmap) ||
 				    !uxa_screen->info->prepare_composite(PictOpAdd,
 									 this_atlas, NULL, mask,
-									 src_pixmap, NULL, pixmap))
+									 src_pixmap, NULL, pixmap)) {
+					FreePicture(mask, 0);
 					return -1;
+				}
 
 				glyph_atlas = this_atlas;
 			}
-- 
1.7.10