diff options
author | Alexis Ballier <aballier@gentoo.org> | 2010-05-02 07:54:00 +0000 |
---|---|---|
committer | Alexis Ballier <aballier@gentoo.org> | 2010-05-02 07:54:00 +0000 |
commit | a9c9da8b1d3e2bb04794ae7991792872afd681d6 (patch) | |
tree | 7a813b8c39dd2569c7ac3bca8c1b52dffe953a47 /media-libs/silgraphite | |
parent | Version bump (diff) | |
download | gentoo-2-a9c9da8b1d3e2bb04794ae7991792872afd681d6.tar.gz gentoo-2-a9c9da8b1d3e2bb04794ae7991792872afd681d6.tar.bz2 gentoo-2-a9c9da8b1d3e2bb04794ae7991792872afd681d6.zip |
fix unaligned reads; bug #304921
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'media-libs/silgraphite')
-rw-r--r-- | media-libs/silgraphite/ChangeLog | 6 | ||||
-rw-r--r-- | media-libs/silgraphite/files/silgraphite-2.3.1-aligned_access.patch | 63 | ||||
-rw-r--r-- | media-libs/silgraphite/silgraphite-2.3.1.ebuild | 8 |
3 files changed, 75 insertions, 2 deletions
diff --git a/media-libs/silgraphite/ChangeLog b/media-libs/silgraphite/ChangeLog index 87648ba0fad3..040122f6f4cf 100644 --- a/media-libs/silgraphite/ChangeLog +++ b/media-libs/silgraphite/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for media-libs/silgraphite # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-libs/silgraphite/ChangeLog,v 1.12 2010/04/26 18:43:03 grobian Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-libs/silgraphite/ChangeLog,v 1.13 2010/05/02 07:54:00 aballier Exp $ + + 02 May 2010; Alexis Ballier <aballier@gentoo.org> + silgraphite-2.3.1.ebuild, +files/silgraphite-2.3.1-aligned_access.patch: + fix unaligned reads; bug #304921 26 Apr 2010; Fabian Groffen <grobian@gentoo.org> silgraphite-2.3.1.ebuild: Marked ~sparc-solaris, ~sparc64-solaris diff --git a/media-libs/silgraphite/files/silgraphite-2.3.1-aligned_access.patch b/media-libs/silgraphite/files/silgraphite-2.3.1-aligned_access.patch new file mode 100644 index 000000000000..ee5c1702e92e --- /dev/null +++ b/media-libs/silgraphite/files/silgraphite-2.3.1-aligned_access.patch @@ -0,0 +1,63 @@ +Fix unaligned reads. +https://bugs.gentoo.org/show_bug.cgi?id=304921 + +Upstream: +https://sourceforge.net/tracker/?func=detail&aid=2995413&group_id=66144&atid=513479 + +Index: silgraphite-2.3.1/engine/src/segment/FileInput.cpp +=================================================================== +--- silgraphite-2.3.1.orig/engine/src/segment/FileInput.cpp ++++ silgraphite-2.3.1/engine/src/segment/FileInput.cpp +@@ -41,6 +41,10 @@ DEFINE_THIS_FILE + + //:End Ignore + ++#define RAW_READ(var,size,buf) \ ++ for(int i = 0; i < isizeof(size);i++){\ ++ var |= buf[i]<<8*(isizeof(size)-i-1);\ ++ } + //:>******************************************************************************************** + //:> Forward declarations + //:>******************************************************************************************** +@@ -133,11 +137,11 @@ byte GrBufferIStream::ReadByteFromFont() + ----------------------------------------------------------------------------------------------*/ + short GrBufferIStream::ReadShortFromFont() + { +- short snInput = *(short *)m_pbNext; ++ short snInput = 0; ++ RAW_READ(snInput,short,m_pbNext); + m_pbNext += isizeof(short); + if (m_pbLim && m_pbNext > m_pbLim) + THROW(kresReadFault); +- snInput = lsbf(snInput); + return snInput; + } + +@@ -147,11 +151,11 @@ short GrBufferIStream::ReadShortFromFont + ----------------------------------------------------------------------------------------------*/ + utf16 GrBufferIStream::ReadUShortFromFont() + { +- utf16 chwInput = *(utf16 *)m_pbNext; ++ utf16 chwInput = 0; ++ RAW_READ(chwInput,utf16,m_pbNext); + m_pbNext += isizeof(utf16); + if (m_pbLim && m_pbNext > m_pbLim) + THROW(kresReadFault); +- chwInput = lsbf(chwInput); + return chwInput; + } + +@@ -161,11 +165,11 @@ utf16 GrBufferIStream::ReadUShortFromFon + ----------------------------------------------------------------------------------------------*/ + int GrBufferIStream::ReadIntFromFont() + { +- int nInput = *(int *)m_pbNext; ++ int nInput = 0; ++ RAW_READ(nInput,int,m_pbNext); + m_pbNext += isizeof(int); + if (m_pbLim && m_pbNext > m_pbLim) + THROW(kresReadFault); +- nInput = lsbf(nInput); + return nInput; + } + diff --git a/media-libs/silgraphite/silgraphite-2.3.1.ebuild b/media-libs/silgraphite/silgraphite-2.3.1.ebuild index f255ff4b5005..eb45c81e5c55 100644 --- a/media-libs/silgraphite/silgraphite-2.3.1.ebuild +++ b/media-libs/silgraphite/silgraphite-2.3.1.ebuild @@ -1,9 +1,11 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-libs/silgraphite/silgraphite-2.3.1.ebuild,v 1.12 2010/04/26 18:43:03 grobian Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-libs/silgraphite/silgraphite-2.3.1.ebuild,v 1.13 2010/05/02 07:54:00 aballier Exp $ EAPI="2" +inherit eutils + DESCRIPTION="Rendering engine for complex non-Roman writing systems" HOMEPAGE="http://graphite.sil.org/" SRC_URI="mirror://sourceforge/${PN}/${PV}/${P}.tar.gz" @@ -19,6 +21,10 @@ RDEPEND="xft? ( x11-libs/libXft ) DEPEND="${RDEPEND} dev-util/pkgconfig" +src_prepare() { + epatch "${FILESDIR}/${P}-aligned_access.patch" +} + src_configure() { econf \ $(use_with xft) \ |