[cairo-commit] src/cairo-glitz-surface.c

罗晶华 Jinghua Luo jinghua at kemper.freedesktop.org
Fri Dec 22 06:05:45 PST 2006


 src/cairo-glitz-surface.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

New commits:
diff-tree 39ce31ade64e1c3b9e5880134ab77ca96f48f1b9 (from 344901a1a128b7e843c3bff0a4a12c36be7acbc8)
Author: Jinghua Luo <sunmoon1997 at gmail.com>
Date:   Fri Dec 22 22:05:20 2006 +0800

    Glitz: fix a potential use after free bug in _cairo_glitz_surface_old_show_glyphs.
    
    There is a race condition between glyph unlocking and glyph cache thawing.
    Moving down _cairo_scaled_font_thaw_cache a few lines fixes the problem and make
    crashes go away.

diff --git a/src/cairo-glitz-surface.c b/src/cairo-glitz-surface.c
index 3b23691..c8e02c9 100644
--- a/src/cairo-glitz-surface.c
+++ b/src/cairo-glitz-surface.c
@@ -2109,8 +2109,6 @@ _cairo_glitz_surface_old_show_glyphs (ca
     }
 
 UNLOCK:
-    _cairo_scaled_font_thaw_cache (scaled_font);
-
     if (cached_glyphs)
     {
 	for (i = 0; i < num_glyphs; i++)
@@ -2121,6 +2119,8 @@ UNLOCK:
 	}
     }
 
+    _cairo_scaled_font_thaw_cache (scaled_font);
+
     glitz_buffer_destroy (buffer);
 
  FAIL2:


More information about the cairo-commit mailing list