Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: gnome-base/librsvg/, gnome-base/librsvg/files/
Date: Sun, 28 Feb 2016 12:02:58
Message-Id: 1456660948.0c92c018114f9c82a85c24d43b09056e3f92eafa.pacho@gentoo
1 commit: 0c92c018114f9c82a85c24d43b09056e3f92eafa
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 28 11:25:56 2016 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 28 12:02:28 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c92c018
7
8 gnome-base/librsvg: Fix crashes when filters don't exist (#575496 by Andreas Grois)
9
10 Package-Manager: portage-2.2.27
11
12 .../files/librsvg-2.40.13-filters-crash.patch | 53 +++++++++++
13 gnome-base/librsvg/librsvg-2.40.13-r1.ebuild | 102 +++++++++++++++++++++
14 2 files changed, 155 insertions(+)
15
16 diff --git a/gnome-base/librsvg/files/librsvg-2.40.13-filters-crash.patch b/gnome-base/librsvg/files/librsvg-2.40.13-filters-crash.patch
17 new file mode 100644
18 index 0000000..f5503d1
19 --- /dev/null
20 +++ b/gnome-base/librsvg/files/librsvg-2.40.13-filters-crash.patch
21 @@ -0,0 +1,53 @@
22 +From d937c691678803ceda6be701587d997ccd03a1da Mon Sep 17 00:00:00 2001
23 +From: Benjamin Otte <otte@××××××.com>
24 +Date: Fri, 29 Jan 2016 12:49:55 +0100
25 +Subject: Don't crash when filters don't exist
26 +
27 +We put a new surface on the stack if a filter existed by name but we
28 +didn't pop it if the name didn't resolve to a real filter.
29 +
30 +New test: crash/bug759084.svg
31 +
32 +https://bugzilla.gnome.org/show_bug.cgi?id=759084
33 +---
34 + rsvg-cairo-draw.c | 6 +++---
35 + tests/fixtures/crash/bug759084.svg | 9 +++++++++
36 + 2 files changed, 12 insertions(+), 3 deletions(-)
37 + create mode 100644 tests/fixtures/crash/bug759084.svg
38 +
39 +diff --git a/rsvg-cairo-draw.c b/rsvg-cairo-draw.c
40 +index 4d8fbc2..4152cb7 100644
41 +--- a/rsvg-cairo-draw.c
42 ++++ b/rsvg-cairo-draw.c
43 +@@ -819,10 +819,10 @@ rsvg_cairo_pop_render_stack (RsvgDrawingCtx * ctx)
44 + cairo_surface_t *output;
45 +
46 + filter = rsvg_acquire_node (ctx, state->filter);
47 +- if (filter && RSVG_NODE_TYPE (filter) == RSVG_NODE_TYPE_FILTER) {
48 +- output = render->surfaces_stack->data;
49 +- render->surfaces_stack = g_list_delete_link (render->surfaces_stack, render->surfaces_stack);
50 ++ output = render->surfaces_stack->data;
51 ++ render->surfaces_stack = g_list_delete_link (render->surfaces_stack, render->surfaces_stack);
52 +
53 ++ if (filter && RSVG_NODE_TYPE (filter) == RSVG_NODE_TYPE_FILTER) {
54 + needs_destroy = TRUE;
55 + surface = rsvg_filter_render ((RsvgFilter *) filter, output, ctx, &render->bbox, "2103");
56 + /* Don't destroy the output surface, it's owned by child_cr */
57 +diff --git a/tests/fixtures/crash/bug759084.svg b/tests/fixtures/crash/bug759084.svg
58 +new file mode 100644
59 +index 0000000..9e8f8f1
60 +--- /dev/null
61 ++++ b/tests/fixtures/crash/bug759084.svg
62 +@@ -0,0 +1,9 @@
63 ++<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
64 ++ <defs>
65 ++ <filter id="filter">
66 ++ </filter>
67 ++ </defs>
68 ++ <g filter="url(#filter)">
69 ++ <rect fill="red" width="10" height="10" filter="url(#doesnotexist)" />
70 ++ </g>
71 ++</svg>
72 +--
73 +cgit v0.12
74 +
75
76 diff --git a/gnome-base/librsvg/librsvg-2.40.13-r1.ebuild b/gnome-base/librsvg/librsvg-2.40.13-r1.ebuild
77 new file mode 100644
78 index 0000000..7a0f5bc
79 --- /dev/null
80 +++ b/gnome-base/librsvg/librsvg-2.40.13-r1.ebuild
81 @@ -0,0 +1,102 @@
82 +# Copyright 1999-2015 Gentoo Foundation
83 +# Distributed under the terms of the GNU General Public License v2
84 +# $Id$
85 +
86 +EAPI="5"
87 +GCONF_DEBUG="no"
88 +GNOME2_LA_PUNT="yes"
89 +VALA_USE_DEPEND="vapigen"
90 +
91 +inherit autotools gnome2 multilib-minimal vala
92 +
93 +DESCRIPTION="Scalable Vector Graphics (SVG) rendering library"
94 +HOMEPAGE="https://wiki.gnome.org/Projects/LibRsvg"
95 +
96 +LICENSE="LGPL-2"
97 +SLOT="2"
98 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
99 +
100 +IUSE="+introspection vala tools"
101 +REQUIRED_USE="vala? ( introspection )"
102 +
103 +RDEPEND="
104 + >=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}]
105 + >=x11-libs/cairo-1.12.14-r4[${MULTILIB_USEDEP}]
106 + >=x11-libs/pango-1.36.3[${MULTILIB_USEDEP}]
107 + >=dev-libs/libxml2-2.9.1-r4:2[${MULTILIB_USEDEP}]
108 + >=dev-libs/libcroco-0.6.8-r1[${MULTILIB_USEDEP}]
109 + >=x11-libs/gdk-pixbuf-2.30.7:2[introspection?,${MULTILIB_USEDEP}]
110 + introspection? ( >=dev-libs/gobject-introspection-0.10.8:= )
111 + tools? ( >=x11-libs/gtk+-3.10.0:3 )
112 +"
113 +DEPEND="${RDEPEND}
114 + dev-libs/gobject-introspection-common
115 + dev-libs/vala-common
116 + >=dev-util/gtk-doc-am-1.13
117 + >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
118 + vala? ( $(vala_depend) )
119 +"
120 +# >=gtk-doc-am-1.13, gobject-introspection-common, vala-common needed by eautoreconf
121 +
122 +src_prepare() {
123 + # https://bugzilla.gnome.org/show_bug.cgi?id=653323
124 + epatch "${FILESDIR}/${PN}-2.40.12-gtk-optional.patch"
125 +
126 + # https://bugzilla.gnome.org/show_bug.cgi?id=731826
127 + epatch "${FILESDIR}/${PN}-2.40.2-vala-out-of-source.patch"
128 +
129 + # Don't crash when filters don't exist (included in next release)
130 + epatch "${FILESDIR}/${P}-filters-crash.patch"
131 +
132 + eautoreconf
133 +
134 + use vala && vala_src_prepare
135 + gnome2_src_prepare
136 +}
137 +
138 +multilib_src_configure() {
139 + local myconf=()
140 +
141 + # -Bsymbolic is not supported by the Darwin toolchain
142 + if [[ ${CHOST} == *-darwin* ]]; then
143 + myconf+=( --disable-Bsymbolic )
144 + fi
145 +
146 + # --disable-tools even when USE=tools; the tools/ subdirectory is useful
147 + # only for librsvg developers
148 + ECONF_SOURCE=${S} \
149 + gnome2_src_configure \
150 + --disable-static \
151 + --disable-tools \
152 + $(multilib_native_use_enable introspection) \
153 + $(multilib_native_use_with tools gtk3) \
154 + $(multilib_native_use_enable vala) \
155 + --enable-pixbuf-loader \
156 + "${myconf[@]}"
157 +
158 + if multilib_is_native_abi; then
159 + ln -s "${S}"/doc/html doc/html || die
160 + fi
161 +}
162 +
163 +multilib_src_compile() {
164 + # causes segfault if set, see bug #411765
165 + unset __GL_NO_DSO_FINALIZER
166 + gnome2_src_compile
167 +}
168 +
169 +multilib_src_install() {
170 + gnome2_src_install
171 +}
172 +
173 +pkg_postinst() {
174 + # causes segfault if set, see bug 375615
175 + unset __GL_NO_DSO_FINALIZER
176 + multilib_foreach_abi gnome2_pkg_postinst
177 +}
178 +
179 +pkg_postrm() {
180 + # causes segfault if set, see bug 375615
181 + unset __GL_NO_DSO_FINALIZER
182 + multilib_foreach_abi gnome2_pkg_postrm
183 +}