summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-04-05 13:28:08 -0400
committerMike Frysinger <vapier@gentoo.org>2016-04-05 13:28:14 -0400
commit754b25e1b738fcff29b16148ef70408f28448532 (patch)
treed03ff4c244a67925dbd200c5b224fe467ce4d53e
parentmedia-libs/imlib2: always depend on pkg-config (diff)
downloadgentoo-754b25e1b738fcff29b16148ef70408f28448532.tar.gz
gentoo-754b25e1b738fcff29b16148ef70408f28448532.tar.bz2
gentoo-754b25e1b738fcff29b16148ef70408f28448532.zip
media-libs/imlib2: add upstream fix for gif oob reads #578810
-rw-r--r--media-libs/imlib2/files/imlib2-1.4.8-gif-oob.patch39
-rw-r--r--media-libs/imlib2/imlib2-1.4.8-r1.ebuild (renamed from media-libs/imlib2/imlib2-1.4.8.ebuild)9
2 files changed, 47 insertions, 1 deletions
diff --git a/media-libs/imlib2/files/imlib2-1.4.8-gif-oob.patch b/media-libs/imlib2/files/imlib2-1.4.8-gif-oob.patch
new file mode 100644
index 000000000000..ed297579e226
--- /dev/null
+++ b/media-libs/imlib2/files/imlib2-1.4.8-gif-oob.patch
@@ -0,0 +1,39 @@
+From 16de244bd03d2f75da6508feb1ad9cb4e668e9dc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bernhard=20=C3=9Cbelacker?= <bernhardu@vr-web.de>
+Date: Sat, 2 Apr 2016 13:05:21 -0400
+Subject: [PATCH] gif: fix oob reads w/bad colormaps
+
+Verify the color map is inbounds before indexing with it.
+
+https://bugs.debian.org/785369
+---
+ src/modules/loaders/loader_gif.c | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/src/modules/loaders/loader_gif.c b/src/modules/loaders/loader_gif.c
+index 638df59..7bdf29c 100644
+--- a/src/modules/loaders/loader_gif.c
++++ b/src/modules/loaders/loader_gif.c
+@@ -170,9 +170,16 @@ load(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity,
+ }
+ else
+ {
+- r = cmap->Colors[rows[i][j]].Red;
+- g = cmap->Colors[rows[i][j]].Green;
+- b = cmap->Colors[rows[i][j]].Blue;
++ if (rows[i][j] < cmap->ColorCount)
++ {
++ r = cmap->Colors[rows[i][j]].Red;
++ g = cmap->Colors[rows[i][j]].Green;
++ b = cmap->Colors[rows[i][j]].Blue;
++ }
++ else
++ {
++ r = g = b = 0;
++ }
+ *ptr++ = (0xff << 24) | (r << 16) | (g << 8) | b;
+ }
+ per += per_inc;
+--
+2.7.4
+
diff --git a/media-libs/imlib2/imlib2-1.4.8.ebuild b/media-libs/imlib2/imlib2-1.4.8-r1.ebuild
index 9856d982453b..76973db08cf1 100644
--- a/media-libs/imlib2/imlib2-1.4.8.ebuild
+++ b/media-libs/imlib2/imlib2-1.4.8-r1.ebuild
@@ -11,11 +11,13 @@ if [[ ${PV} != "9999" ]] ; then
EKEY_STATE="snap"
fi
-inherit enlightenment toolchain-funcs multilib-minimal
+inherit enlightenment toolchain-funcs multilib-minimal eutils
DESCRIPTION="Version 2 of an advanced replacement library for libraries like libXpm"
HOMEPAGE="https://www.enlightenment.org/"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
IUSE="bzip2 gif jpeg cpu_flags_x86_mmx cpu_flags_x86_sse2 mp3 png static-libs tiff X zlib"
RDEPEND="=media-libs/freetype-2*[${MULTILIB_USEDEP}]
@@ -37,6 +39,11 @@ DEPEND="${RDEPEND}
>=x11-proto/xproto-7.0.24[${MULTILIB_USEDEP}]
)"
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-gif-oob.patch #578810
+ enlightenment_src_prepare
+}
+
multilib_src_configure() {
# imlib2 has diff configure options for x86/amd64 assembly
if [[ $(tc-arch) == amd64 ]]; then