Backport an upstream patch for eog get_buddy() crashes
https://bugzilla.redhat.com/show_bug.cgi?id=912030
This commit is contained in:
parent
cbb90b4f03
commit
f723e2834f
@ -0,0 +1,34 @@
|
|||||||
|
From 01a8bf01c6508a4fea8d40371c3049e7a2f7908a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Chris Wilson <chris@chris-wilson.co.uk>
|
||||||
|
Date: Fri, 15 Mar 2013 09:08:00 +0000
|
||||||
|
Subject: [PATCH] mempool: Reduce an assert into an error return for
|
||||||
|
get_buddy()
|
||||||
|
|
||||||
|
If we ask for a buddy that is outside of our allocation that is an
|
||||||
|
error that should not happen with a power-of-two allocated zone...
|
||||||
|
However, since it has been seen in the wild, we can safely return that
|
||||||
|
there is no buddy rather than die in a too-late assert.
|
||||||
|
|
||||||
|
Reported-by: Anton Eliasson <devel@antoneliasson.se>
|
||||||
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
||||||
|
---
|
||||||
|
src/cairo-mempool.c | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/cairo-mempool.c b/src/cairo-mempool.c
|
||||||
|
index 96e4a62..751ede3 100644
|
||||||
|
--- a/src/cairo-mempool.c
|
||||||
|
+++ b/src/cairo-mempool.c
|
||||||
|
@@ -157,7 +157,8 @@ get_buddy (cairo_mempool_t *pool, size_t offset, int bits)
|
||||||
|
{
|
||||||
|
struct _cairo_memblock *block;
|
||||||
|
|
||||||
|
- assert (offset + (1 << bits) <= pool->num_blocks);
|
||||||
|
+ if (offset + (1 << bits) >= pool->num_blocks)
|
||||||
|
+ return NULL; /* invalid */
|
||||||
|
|
||||||
|
if (BITTEST (pool, offset + (1 << bits) - 1))
|
||||||
|
return NULL; /* buddy is allocated */
|
||||||
|
--
|
||||||
|
1.8.1.4
|
||||||
|
|
@ -5,7 +5,7 @@
|
|||||||
Summary: A 2D graphics library
|
Summary: A 2D graphics library
|
||||||
Name: cairo
|
Name: cairo
|
||||||
Version: 1.12.14
|
Version: 1.12.14
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
URL: http://cairographics.org
|
URL: http://cairographics.org
|
||||||
#VCS: git:git://git.freedesktop.org/git/cairo
|
#VCS: git:git://git.freedesktop.org/git/cairo
|
||||||
#Source0: http://cairographics.org/snapshots/%{name}-%{version}.tar.gz
|
#Source0: http://cairographics.org/snapshots/%{name}-%{version}.tar.gz
|
||||||
@ -15,6 +15,7 @@ Group: System Environment/Libraries
|
|||||||
|
|
||||||
Patch0: 0001-xlib-Don-t-crash-when-swapping-a-0-sized-glyph.patch
|
Patch0: 0001-xlib-Don-t-crash-when-swapping-a-0-sized-glyph.patch
|
||||||
Patch1: 0002-xcb-Don-t-crash-when-swapping-a-0-sized-glyph.patch
|
Patch1: 0002-xcb-Don-t-crash-when-swapping-a-0-sized-glyph.patch
|
||||||
|
Patch2: 0003-mempool-Reduce-an-assert-into-an-error-return-for-ge.patch
|
||||||
|
|
||||||
BuildRequires: pkgconfig
|
BuildRequires: pkgconfig
|
||||||
BuildRequires: libXrender-devel
|
BuildRequires: libXrender-devel
|
||||||
@ -96,6 +97,7 @@ This package contains tools for working with the cairo graphics library.
|
|||||||
%setup -q
|
%setup -q
|
||||||
%patch0 -p1 -b .xlib-swap
|
%patch0 -p1 -b .xlib-swap
|
||||||
%patch1 -p1 -b .xcb-swap
|
%patch1 -p1 -b .xcb-swap
|
||||||
|
%patch2 -p1 -b .get_buddy-assert
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%configure --disable-static \
|
%configure --disable-static \
|
||||||
@ -179,6 +181,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.la
|
|||||||
%{_libdir}/cairo/
|
%{_libdir}/cairo/
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat May 25 2013 Kalev Lember <kalevlember@gmail.com> 1.12.14-2
|
||||||
|
- Backport an upstream patch for eog get_buddy() crashes (#912030)
|
||||||
|
|
||||||
* Tue Feb 12 2013 Adam Jackson <ajax@redhat.com> 1.12.14-1
|
* Tue Feb 12 2013 Adam Jackson <ajax@redhat.com> 1.12.14-1
|
||||||
- cairo 1.12.14
|
- cairo 1.12.14
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user