diff options
Diffstat (limited to 'media-libs/libjpeg-turbo')
-rw-r--r-- | media-libs/libjpeg-turbo/Manifest | 5 | ||||
-rw-r--r-- | media-libs/libjpeg-turbo/files/libjpeg-turbo-1.5.3-divzero_fix.patch | 18 | ||||
-rw-r--r-- | media-libs/libjpeg-turbo/files/libjpeg-turbo-1.5.90-divzero_fix.patch | 41 | ||||
-rw-r--r-- | media-libs/libjpeg-turbo/libjpeg-turbo-1.5.3-r1.ebuild | 120 | ||||
-rw-r--r-- | media-libs/libjpeg-turbo/libjpeg-turbo-1.5.90-r1.ebuild (renamed from media-libs/libjpeg-turbo/libjpeg-turbo-1.5.90.ebuild) | 8 |
5 files changed, 189 insertions, 3 deletions
diff --git a/media-libs/libjpeg-turbo/Manifest b/media-libs/libjpeg-turbo/Manifest index 144cc93bf0cb..80254225a3ab 100644 --- a/media-libs/libjpeg-turbo/Manifest +++ b/media-libs/libjpeg-turbo/Manifest @@ -1,4 +1,6 @@ AUX libjpeg-turbo-1.2.0-x32.patch 1248 BLAKE2B 760f35a02c6a565a43702a4188186732f93c57a5c879cdc6920c427da097c3dc5eb111189c40510252c0209caf63100ecff7ffec1b10a177b09449db4dc5c3c6 SHA512 9ffc28a89db43eba9545bca2d4c1f5a11953f36a46e294b697bda190058dcaa59982f83552ce54f37ef83970d4b0fefd1e14497854c7991db38ab7f7c1c6afae +AUX libjpeg-turbo-1.5.3-divzero_fix.patch 792 BLAKE2B 31d3617155ac639ebd49a5db9c3898fdd6b20dc04776003121d6c906a96a8963984405b674ad6bee81c6de97304da78fa1de249cca7000fa7eed42f011e5a918 SHA512 b8ba793319e1f8c658f550fe6427625b2053486d784133c6b9e6778fac74c4eedadb6b9c208c6725a27cf585b4857c719ae03efaf602e181c4b782d55cb9b47a +AUX libjpeg-turbo-1.5.90-divzero_fix.patch 1842 BLAKE2B a333583386296323b72ec05009d72f9cf61c76f992b72dfeb4b5e4ce8a80118033856b30ad44ca9f1bbf89e3cdc79bf15fb039715df9cd8080ba184b903a465a SHA512 0a6e6c7e60dfb4dcf067a89766665485cdf8fdc64ced2104b3bcecab066a1cce74c77c5820665c601175ded36c9e1647c0a4b8be9a827c6d0d16f7f998f18a7e DIST libjpeg-turbo-1.5.0.tar.gz 1654276 BLAKE2B b3f1ad4c6bbe5b75ef8daa38e0ccf6165616768d1427d41f9b5cc6f5775720d2977aff6758ec0a9679c9eabc7c2395d4cdecdcb22c92522900de52900281b9bd SHA512 3b7249a5f5c7b1f1fa99924ac6bc9bff3bf811815ef38505af5359d1f0edb0bfb771f0fa54308743a2d9305cb19a997453fdb00d0aade3f2f17ea917a45fde22 DIST libjpeg-turbo-1.5.1.tar.gz 1650647 BLAKE2B 5e9eb7889c430a735a8b8ac22fbf66fc98102acf372d08aa2dbd86ac55d43c5700438a77925f894c473e81289e4d3d2e6fe3da435d2799db21782da9bd5dfe41 SHA512 a03823cf4b3d1aada24e502fea0a979b1f656c01e55ffddc06013b9c79509c2da1e3bcf0b85282289451d77d4cb5f56dd8cbf6e492744836ddda1f7136534852 DIST libjpeg-turbo-1.5.2.tar.gz 1657235 BLAKE2B 8d26af1cf6219e02f13f8729b688175590b01a4ce538ae861e72e6344a319475f8114ad05aefe2f8ffd6b5481c7915bd18097466408729d80212a2db7f99ad5c SHA512 c7fe5cc77e38fad33af3f10e6db961c8edf033a86c09541121f49bfa20547179760924e6d3e397f0add7030459ff3babadd3457ab2da4a40a2147dc1574aa444 @@ -8,6 +10,7 @@ DIST libjpeg8_8d-2.debian.tar.gz 14764 BLAKE2B e93d12afa062da28b717b540492221f70 EBUILD libjpeg-turbo-1.5.0.ebuild 2861 BLAKE2B 4110c8947b54c3959a8bcf10a57810fca35ff31e389b51d32b03d5ab15db542ebf63d931c8aa926da4b3c49d1b005031fd2468ade8a0c980714f77a76310538e SHA512 3aa56d232af1153e2c7747d7d390d11d43ff3955691420d8d3247ce104f6b959e55fa83bafa601401cb0095944504c5474b3564b98762907cf413ad504643c45 EBUILD libjpeg-turbo-1.5.1.ebuild 2923 BLAKE2B 67850bed77be9bd0b06c1d4c4f95bcdd73430e8b26e1698409213837edaee047578f79b4f019979aab48dbfac6210272594b28aacba1d25e6237034c85e3c4d6 SHA512 13e10d81a0543f6b7cf44b185c3534aa08e2fc07bcb243aa159bc3fcd6194ed7d7e4f8bee51570acf0962731275a4f2d91cdfa931b62ec370e54f27487bf13ff EBUILD libjpeg-turbo-1.5.2.ebuild 2925 BLAKE2B c519f100505bcccb2d7b9192e26d5ffcc2d881b4bfc90b3e2e4f72447512686745434e4754f8393c14d4d2b7a285a6bc2d0ba0dd20a9916f00e2cccb85129023 SHA512 4e320a1a69fb0ca060ea35a9e2cc5aa7a971ad727bf661c9f64472874200a941f1502eecbe99d26642b21f06a4c1c3faf6d57885ccc63e1e9ec5edb3a7746d11 +EBUILD libjpeg-turbo-1.5.3-r1.ebuild 2982 BLAKE2B b439df02f28f006fc0feb319f10a7e1f2ab4190c5f3a4fa03999c785db4c6c52cc5d78cc69fd0c080e521bffec0dbcacdd02253ab1dd13763fee4a07e202d40b SHA512 41d082e0245ddbd4fd2b3a85e01ac57132cf75af146327171287463c846b8b03fbd502ef114ae1e22cb38df808d969dec15f6a247063684ad2054da606e83190 EBUILD libjpeg-turbo-1.5.3.ebuild 2935 BLAKE2B bb75f57fbc1926c3973660a52c531020c5e6a105d443b2df068f1db472d1395f4361136b56e3c9a1a88e219511706cd96025b0f44235adee2090dbd8880bf867 SHA512 cf593ba887b822db77155d348789d74435e6209e72918afb5b323085c5c1e9ea03ac8bfee2f03dd279ce477a2116539ef76159980063da2a8c83175a6dd482a2 -EBUILD libjpeg-turbo-1.5.90.ebuild 2661 BLAKE2B e799b56dbc2c854eb371c3efe184c615467ab994868306d9fc9a1999c407ee253fdabe3389464c511af1e63d080a8dab195c00e4cdd7c914ffa791504a3cb066 SHA512 c9f1200c3fd1c36e40c5d88f227b72cd276ceb91fd8f6c93db5232e272b7fffe728d02b3935c3ba623ca1732fc42be86802ba68b81734f5bb485d56688904e50 +EBUILD libjpeg-turbo-1.5.90-r1.ebuild 2698 BLAKE2B 4786d22cb95af6dcfa56a4f43b68380f21998521770a3551dc66f9ece54d0dd7338e31b1cf7296ab8bbb78d1ae27712918068ff2f06e12dbcfdb5b09ff54d2e8 SHA512 9f7ccf0cd31fcd101497eb30638889d952aec827e721c4414883035b95aa6f68dd94dcce6c16b1e06150b7ba01618094a2d5648021f4ec2abda2588686d3c0d7 MISC metadata.xml 466 BLAKE2B 989b0d905baa9ba6217f871c43b1d06f8ea718ab7250d31cce0d498b219b3d1077638b2fecfaeb747e2505f2608d73390789bd442462a9e2f410b0939e2dbb77 SHA512 2b8725c3493aa2294b43f3328f3506458254f57b8ac2914b96a7bbf987caa4c6a011e7afe72099bd0d33ff605c018853efde3e77faf2bcb012d7e49d229f17ea diff --git a/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.5.3-divzero_fix.patch b/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.5.3-divzero_fix.patch new file mode 100644 index 000000000000..c7e6d1056769 --- /dev/null +++ b/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.5.3-divzero_fix.patch @@ -0,0 +1,18 @@ +Backported from +https://github.com/libjpeg-turbo/libjpeg-turbo/commit/43e84cff1bb2bd8293066f6ac4eb0df61ddddbc6 + +--- libjpeg-turbo-1.5.3/rdbmp.c ++++ libjpeg-turbo-1.5.3/rdbmp.c +@@ -434,6 +434,12 @@ + progress->total_extra_passes++; /* count file input as separate pass */ + } + ++ /* Ensure that biWidth * cinfo->input_components doesn't exceed the maximum ++ value of the JDIMENSION type. This is only a danger with BMP files, since ++ their width and height fields are 32-bit integers. */ ++ if ((unsigned long long)biWidth * ++ (unsigned long long)cinfo->input_components > 0xFFFFFFFFULL) ++ ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + /* Allocate one-row buffer for returned data */ + source->pub.buffer = (*cinfo->mem->alloc_sarray) + ((j_common_ptr) cinfo, JPOOL_IMAGE, diff --git a/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.5.90-divzero_fix.patch b/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.5.90-divzero_fix.patch new file mode 100644 index 000000000000..d505499a082d --- /dev/null +++ b/media-libs/libjpeg-turbo/files/libjpeg-turbo-1.5.90-divzero_fix.patch @@ -0,0 +1,41 @@ +From 43e84cff1bb2bd8293066f6ac4eb0df61ddddbc6 Mon Sep 17 00:00:00 2001 +From: DRC <information@libjpeg-turbo.org> +Date: Tue, 12 Jun 2018 20:27:00 -0500 +Subject: [PATCH] tjLoadImage(): Fix FPE triggered by malformed BMP + +In rdbmp.c, it is necessary to guard against 32-bit overflow/wraparound +when allocating the row buffer, because since BMP files have 32-bit +width and height fields, the value of biWidth can be up to 4294967295. +Specifically, if biWidth is 1073741824 and cinfo->input_components = 4, +then the samplesperrow argument in alloc_sarray() would wrap around to +0, and a division by zero error would occur at line 458 in jmemmgr.c. + +If biWidth is set to a higher value, then samplesperrow would wrap +around to a small number, which would likely cause a buffer overflow +(this has not been tested or verified.) +diff --git a/rdbmp.c b/rdbmp.c +index fcabbb13e..a02cfd909 100644 +--- a/rdbmp.c ++++ b/rdbmp.c +@@ -6,7 +6,7 @@ + * Modified 2009-2010 by Guido Vollbeding. + * libjpeg-turbo Modifications: + * Modified 2011 by Siarhei Siamashka. +- * Copyright (C) 2015, 2017, D. R. Commander. ++ * Copyright (C) 2015, 2017-2018, D. R. Commander. + * For conditions of distribution and use, see the accompanying README.ijg + * file. + * +@@ -623,6 +623,12 @@ start_input_bmp(j_compress_ptr cinfo, cjpeg_source_ptr sinfo) + } + } + ++ /* Ensure that biWidth * cinfo->input_components doesn't exceed the maximum ++ value of the JDIMENSION type. This is only a danger with BMP files, since ++ their width and height fields are 32-bit integers. */ ++ if ((unsigned long long)biWidth * ++ (unsigned long long)cinfo->input_components > 0xFFFFFFFFULL) ++ ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); + /* Allocate one-row buffer for returned data */ + source->pub.buffer = (*cinfo->mem->alloc_sarray) + ((j_common_ptr)cinfo, JPOOL_IMAGE, diff --git a/media-libs/libjpeg-turbo/libjpeg-turbo-1.5.3-r1.ebuild b/media-libs/libjpeg-turbo/libjpeg-turbo-1.5.3-r1.ebuild new file mode 100644 index 000000000000..a18bcc5812bc --- /dev/null +++ b/media-libs/libjpeg-turbo/libjpeg-turbo-1.5.3-r1.ebuild @@ -0,0 +1,120 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools libtool ltprune java-pkg-opt-2 libtool toolchain-funcs multilib-minimal + +DESCRIPTION="MMX, SSE, and SSE2 SIMD accelerated JPEG library" +HOMEPAGE="https://libjpeg-turbo.org/ https://sourceforge.net/projects/libjpeg-turbo/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz + mirror://gentoo/libjpeg8_8d-2.debian.tar.gz" + +LICENSE="BSD IJG" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos" +IUSE="java static-libs" + +ASM_DEPEND="|| ( dev-lang/nasm dev-lang/yasm )" +COMMON_DEPEND="!media-libs/jpeg:0 + !media-libs/jpeg:62" +RDEPEND="${COMMON_DEPEND} + java? ( >=virtual/jre-1.5 )" +DEPEND="${COMMON_DEPEND} + amd64? ( ${ASM_DEPEND} ) + x86? ( ${ASM_DEPEND} ) + amd64-fbsd? ( ${ASM_DEPEND} ) + x86-fbsd? ( ${ASM_DEPEND} ) + amd64-linux? ( ${ASM_DEPEND} ) + x86-linux? ( ${ASM_DEPEND} ) + x64-macos? ( ${ASM_DEPEND} ) + x64-cygwin? ( ${ASM_DEPEND} ) + java? ( >=virtual/jdk-1.5 )" + +MULTILIB_WRAPPED_HEADERS=( /usr/include/jconfig.h ) + +PATCHES=( + "${FILESDIR}"/${PN}-1.2.0-x32.patch #420239 + "${FILESDIR}"/${P}-divzero_fix.patch #658624 +) + +src_prepare() { + default + + eautoreconf + + java-pkg-opt-2_src_prepare +} + +multilib_src_configure() { + local myconf=() + if multilib_is_native_abi; then + myconf+=( $(use_with java) ) + if use java; then + export JAVACFLAGS="$(java-pkg_javac-args)" + export JNI_CFLAGS="$(java-pkg_get-jni-cflags)" + fi + else + myconf+=( --without-java ) + fi + [[ ${ABI} == "x32" ]] && myconf+=( --without-simd ) #420239 + + # Force /bin/bash until upstream generates a new version. #533902 + CONFIG_SHELL="${EPREFIX}"/bin/bash \ + ECONF_SOURCE=${S} \ + econf \ + $(use_enable static-libs static) \ + --with-mem-srcdst \ + "${myconf[@]}" +} + +multilib_src_compile() { + local _java_makeopts + use java && _java_makeopts="-j1" + emake ${_java_makeopts} + + if multilib_is_native_abi; then + pushd ../debian/extra >/dev/null + emake CC="$(tc-getCC)" CFLAGS="${LDFLAGS} ${CFLAGS}" + popd >/dev/null + fi +} + +multilib_src_test() { + emake test +} + +multilib_src_install() { + emake \ + DESTDIR="${D}" \ + docdir="${EPREFIX}"/usr/share/doc/${PF} \ + exampledir="${EPREFIX}"/usr/share/doc/${PF} \ + install + + if multilib_is_native_abi; then + pushd "${WORKDIR}"/debian/extra >/dev/null + emake \ + DESTDIR="${D}" prefix="${EPREFIX}"/usr \ + INSTALL="install -m755" INSTALLDIR="install -d -m755" \ + install + popd >/dev/null + + if use java; then + rm -rf "${ED}"/usr/classes + java-pkg_dojar java/turbojpeg.jar + fi + fi +} + +multilib_src_install_all() { + prune_libtool_files + + insinto /usr/share/doc/${PF}/html + doins -r "${S}"/doc/html/* + newdoc "${WORKDIR}"/debian/changelog changelog.debian + if use java; then + insinto /usr/share/doc/${PF}/html/java + doins -r "${S}"/java/doc/* + newdoc "${S}"/java/README README.java + fi +} diff --git a/media-libs/libjpeg-turbo/libjpeg-turbo-1.5.90.ebuild b/media-libs/libjpeg-turbo/libjpeg-turbo-1.5.90-r1.ebuild index f015b6b01161..0cc09fb72cba 100644 --- a/media-libs/libjpeg-turbo/libjpeg-turbo-1.5.90.ebuild +++ b/media-libs/libjpeg-turbo/libjpeg-turbo-1.5.90-r1.ebuild @@ -3,7 +3,7 @@ EAPI=6 -inherit cmake-multilib java-pkg-opt-2 libtool toolchain-funcs versionator +inherit cmake-multilib eapi7-ver java-pkg-opt-2 libtool toolchain-funcs DESCRIPTION="MMX, SSE, and SSE2 SIMD accelerated JPEG library" HOMEPAGE="https://libjpeg-turbo.org/ https://sourceforge.net/projects/libjpeg-turbo/" @@ -12,7 +12,7 @@ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz LICENSE="BSD IJG" SLOT="0" -[[ "$(get_version_component_range 3)" -ge 90 ]] || \ +[[ "$(ver_cut 3)" -ge 90 ]] || \ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos" IUSE="java static-libs" @@ -34,6 +34,10 @@ DEPEND="${COMMON_DEPEND} MULTILIB_WRAPPED_HEADERS=( /usr/include/jconfig.h ) +PATCHES=( + "${FILESDIR}"/${P}-divzero_fix.patch #658624 +) + src_prepare() { default |