[mingw-cairo] Fix assertion failure when using the latest gtk3 (RHBZ #991829, FD BZ #63787)

Erik van Pienbroek epienbro at fedoraproject.org
Sun Aug 4 22:05:31 UTC 2013


commit 4b0faa4c530e80ee774a30b4d640b2a1b0d5f9c3
Author: Erik van Pienbroek <epienbro at fedoraproject.org>
Date:   Mon Aug 5 00:05:20 2013 +0200

    Fix assertion failure when using the latest gtk3 (RHBZ #991829, FD BZ #63787)

 0001-win32-Fix-image-surface-freeing-loop.patch |   31 +++++++++++++++++++++++
 mingw-cairo.spec                                |    8 +++++-
 2 files changed, 38 insertions(+), 1 deletions(-)
---
diff --git a/0001-win32-Fix-image-surface-freeing-loop.patch b/0001-win32-Fix-image-surface-freeing-loop.patch
new file mode 100644
index 0000000..336125c
--- /dev/null
+++ b/0001-win32-Fix-image-surface-freeing-loop.patch
@@ -0,0 +1,31 @@
+From 9fcd092ce1d59a19a74f48cdbdfbe71bd5f18f9e Mon Sep 17 00:00:00 2001
+From: Michael Henning <drawoc at darkrefraction.com>
+Date: Sun, 21 Jul 2013 22:55:57 -0400
+Subject: [PATCH] win32: Fix image surface freeing loop
+
+Previously, _cairo_win32_display_surface_finish could attempt to destroy
+its patrent while the parent was in the process of being destroyed.
+This simply checks to see if the parent's refcount is zero before freeing it.
+
+https://bugs.freedesktop.org/show_bug.cgi?id=63787
+---
+ src/win32/cairo-win32-display-surface.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/win32/cairo-win32-display-surface.c b/src/win32/cairo-win32-display-surface.c
+index 0390625..f4d27bb 100644
+--- a/src/win32/cairo-win32-display-surface.c
++++ b/src/win32/cairo-win32-display-surface.c
+@@ -415,7 +415,8 @@ _cairo_win32_display_surface_finish (void *abstract_surface)
+ {
+     cairo_win32_display_surface_t *surface = abstract_surface;
+ 
+-    if (surface->image) {
++    if (surface->image &&
++          CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&surface->image->ref_count)) {
+ 	/* Unhook ourselves first to avoid the double-unref from the image */
+ 	to_image_surface(surface->image)->parent = NULL;
+ 	cairo_surface_finish (surface->image);
+-- 
+1.8.3.3
+
diff --git a/mingw-cairo.spec b/mingw-cairo.spec
index 68e2f5d..9a89de6 100644
--- a/mingw-cairo.spec
+++ b/mingw-cairo.spec
@@ -2,7 +2,7 @@
 
 Name:           mingw-cairo
 Version:        1.12.14
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        MinGW Windows Cairo library
 
 License:        LGPLv2 or MPLv1.1
@@ -45,6 +45,8 @@ Patch1: 0001-win32-Free-the-fallback-upon-finish.patch
 Patch2: 0002-win32-fix-corrupted-drawing.patch
 # https://bugs.freedesktop.org/show_bug.cgi?id=63043
 Patch3: 0003-build-sys-do-not-try-to-build-util-sphinx-on-Windows.patch
+# https://bugs.freedesktop.org/show_bug.cgi?id=63787
+Patch4: 0001-win32-Fix-image-surface-freeing-loop.patch
 
 %description
 MinGW Windows Cairo library.
@@ -96,6 +98,7 @@ Static version of the MinGW Windows Cairo library.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 autoreconf -vfi
 
@@ -220,6 +223,9 @@ find $RPM_BUILD_ROOT -name "*.la" -delete
 
 
 %changelog
+* Sun Aug  4 2013 Erik van Pienbroek <epienbro at fedoraproject.org> - 1.12.14-5
+- Fix assertion failure when using the latest gtk3 (RHBZ #991829, FD BZ #63787)
+
 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.12.14-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 


More information about the mingw mailing list