[cairo-commit] src/cairo-win32-font.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Oct 22 13:05:22 PDT 2008


 src/cairo-win32-font.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit e6219f7116311d999054dc31df081aa66a0cd2d3
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Oct 22 17:53:05 2008 +0100

    [win32] Correct error paths in text_to_glyphs().
    
    Carl spotted that 1db894 introduced an error into text_to_glyphs() such
    that following an allocation error the code would attempt to thaw an
    unfrozen glyph cache, leading to an attempt to unlock an unlocked mutex -
    which causes a deadlock under win32.

diff --git a/src/cairo-win32-font.c b/src/cairo-win32-font.c
index 7f6d435..879cfac 100644
--- a/src/cairo-win32-font.c
+++ b/src/cairo-win32-font.c
@@ -672,7 +672,8 @@ _cairo_win32_scaled_font_type1_text_to_glyphs (cairo_win32_scaled_font_t *scaled
 					     &scaled_glyph);
 	if (status) {
 	    free (*glyphs);
-	    goto FAIL3;
+	    *glyphs = NULL;
+	    break;
 	}
 
 	x = scaled_glyph->x_advance;
@@ -682,10 +683,10 @@ _cairo_win32_scaled_font_type1_text_to_glyphs (cairo_win32_scaled_font_t *scaled
 	y_pos += y;
     }
 
-FAIL3:
     _cairo_scaled_font_thaw_cache (&scaled_font->base);
-    cairo_win32_scaled_font_done_font (&scaled_font->base);
 
+FAIL3:
+    cairo_win32_scaled_font_done_font (&scaled_font->base);
 FAIL2:
     free (glyph_indices);
 FAIL1:


More information about the cairo-commit mailing list