diff --git a/extra/libjpeg-turbo/PKGBUILD b/extra/libjpeg-turbo/PKGBUILD index 25797975b..60597422c 100644 --- a/extra/libjpeg-turbo/PKGBUILD +++ b/extra/libjpeg-turbo/PKGBUILD @@ -9,25 +9,25 @@ pkgname=libjpeg-turbo pkgver=1.3.1 -pkgrel=2 +pkgrel=3 pkgdesc='JPEG image codec with accelerated baseline compression and decompression' url='http://libjpeg-turbo.virtualgl.org/' license=('GPL' 'custom') arch=('i686' 'x86_64') source=("http://downloads.sourceforge.net/project/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.gz" - 'libjpeg-turbo-1.3.1-jstdhuff.patch') + 'jstdhuff.patch' + 'overrun.patch') sha1sums=('5fa19252e5ca992cfa40446a0210ceff55fbe468' - 'f459890257df430dc4e2d8bd3060173a1be7516e') + 'f459890257df430dc4e2d8bd3060173a1be7516e' + '438aba2241b19857bab090c6f61bd3f249f27591') provides=('libjpeg=8.0.2' 'turbojpeg') conflicts=('libjpeg' 'turbojpeg') replaces=('libjpeg' 'turbojpeg') prepare() { cd "${srcdir}/${pkgname}-${pkgver}" - # Backport fix for motion JPEG video frames that are encoded without the - # default Huffman tables. Fixes HD webcam input in Chromium (FS#42747). - # http://sourceforge.net/p/libjpeg-turbo/code/1104/ - patch -Np0 -i ../libjpeg-turbo-1.3.1-jstdhuff.patch + patch -p0 -i ../jstdhuff.patch # FS#42747 + patch -p1 -i ../overrun.patch # FS#42922 } build() { diff --git a/extra/libjpeg-turbo/libjpeg-turbo-1.3.1-jstdhuff.patch b/extra/libjpeg-turbo/jstdhuff.patch similarity index 100% rename from extra/libjpeg-turbo/libjpeg-turbo-1.3.1-jstdhuff.patch rename to extra/libjpeg-turbo/jstdhuff.patch diff --git a/extra/libjpeg-turbo/overrun.patch b/extra/libjpeg-turbo/overrun.patch new file mode 100644 index 000000000..92f48c38a --- /dev/null +++ b/extra/libjpeg-turbo/overrun.patch @@ -0,0 +1,21 @@ +diff -Naur old/jchuff.c new/jchuff.c +--- old/jchuff.c 2014-11-27 06:48:21.009442853 -1000 ++++ new/jchuff.c 2014-11-27 06:48:46.289700004 -1000 +@@ -391,7 +391,16 @@ + #endif + + +-#define BUFSIZE (DCTSIZE2 * 2) ++/* Although it is exceedingly rare, it is possible for a Huffman-encoded ++ * coefficient block to be larger than the 128-byte unencoded block. For each ++ * of the 64 coefficients, PUT_BITS is invoked twice, and each invocation can ++ * theoretically store 16 bits (for a maximum of 2048 bits or 256 bytes per ++ * encoded block.) If, for instance, one artificially sets the AC ++ * coefficients to alternating values of 32767 and -32768 (using the JPEG ++ * scanning order-- 1, 8, 16, etc.), then this will produce an encoded block ++ * larger than 200 bytes. ++ */ ++#define BUFSIZE (DCTSIZE2 * 4) + + #define LOAD_BUFFER() { \ + if (state->free_in_buffer < BUFSIZE) { \