aboutsummaryrefslogtreecommitdiff
path: root/graphics/jpeg-turbo
diff options
context:
space:
mode:
authorAntoine Brodin <antoine@FreeBSD.org>2015-09-13 20:27:07 +0000
committerAntoine Brodin <antoine@FreeBSD.org>2015-09-13 20:27:07 +0000
commitebf910c93e1d041b16f112578157957efd68a426 (patch)
treef9381a47bf449519e64d5c0bf372b91645a35a57 /graphics/jpeg-turbo
parenta178d1e1d7352000ce99662c00278a485b78ebaa (diff)
downloadports-ebf910c93e1d041b16f112578157957efd68a426.tar.gz
ports-ebf910c93e1d041b16f112578157957efd68a426.zip
Fix negative shift with IFAST FDCT and qual=100
This fixes regression tests with clang 3.7.0 PR: 202762 Obtained from: https://github.com/libjpeg-turbo/libjpeg-turbo/commit/4cfa3f4c39c2e46eca3a65c67411d15e08a3fc70 Approved by: maintainer timeout (15 days)
Notes
Notes: svn path=/head/; revision=396855
Diffstat (limited to 'graphics/jpeg-turbo')
-rw-r--r--graphics/jpeg-turbo/Makefile2
-rw-r--r--graphics/jpeg-turbo/files/patch-jcdctmgr.c41
2 files changed, 42 insertions, 1 deletions
diff --git a/graphics/jpeg-turbo/Makefile b/graphics/jpeg-turbo/Makefile
index 368408a90abe..504a52d799f6 100644
--- a/graphics/jpeg-turbo/Makefile
+++ b/graphics/jpeg-turbo/Makefile
@@ -3,7 +3,7 @@
PORTNAME= jpeg-turbo
PORTVERSION= 1.4.0
-PORTREVISION?= 0
+PORTREVISION?= 1
CATEGORIES= graphics
MASTER_SITES= SF/lib${PORTNAME}/${PORTVERSION}
DISTNAME= lib${PORTNAME}-${PORTVERSION}
diff --git a/graphics/jpeg-turbo/files/patch-jcdctmgr.c b/graphics/jpeg-turbo/files/patch-jcdctmgr.c
new file mode 100644
index 000000000000..aed62bdac9c6
--- /dev/null
+++ b/graphics/jpeg-turbo/files/patch-jcdctmgr.c
@@ -0,0 +1,41 @@
+--- jcdctmgr.c.orig 2014-11-06 09:32:38 UTC
++++ jcdctmgr.c
+@@ -6,7 +6,7 @@
+ * libjpeg-turbo Modifications:
+ * Copyright (C) 1999-2006, MIYASAKA Masaru.
+ * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
+- * Copyright (C) 2011, 2014 D. R. Commander
++ * Copyright (C) 2011, 2014-2015 D. R. Commander
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains the forward-DCT management logic.
+@@ -175,6 +175,19 @@ compute_reciprocal (UINT16 divisor, DCTE
+ UDCTELEM c;
+ int b, r;
+
++ if (divisor == 1) {
++ /* divisor == 1 means unquantized, so these reciprocal/correction/shift
++ * values will cause the C quantization algorithm to act like the
++ * identity function. Since only the C quantization algorithm is used in
++ * these cases, the scale value is irrelevant.
++ */
++ dtbl[DCTSIZE2 * 0] = (DCTELEM) 1; /* reciprocal */
++ dtbl[DCTSIZE2 * 1] = (DCTELEM) 0; /* correction */
++ dtbl[DCTSIZE2 * 2] = (DCTELEM) 1; /* scale */
++ dtbl[DCTSIZE2 * 3] = (DCTELEM) (-sizeof(DCTELEM) * 8); /* shift */
++ return 0;
++ }
++
+ b = flss(divisor) - 1;
+ r = sizeof(DCTELEM) * 8 + b;
+
+@@ -395,7 +408,8 @@ quantize (JCOEFPTR coef_block, DCTELEM *
+
+ #if BITS_IN_JSAMPLE == 8
+
+- UDCTELEM recip, corr, shift;
++ UDCTELEM recip, corr;
++ int shift;
+ UDCTELEM2 product;
+
+ for (i = 0; i < DCTSIZE2; i++) {