On 2019-11-27, Stuart Henderson <stu@spacehopper.org> wrote:
> Wondering whether it's worth adding this to the port, or whether it's
> uncommon enough that we might as well just wait and pick it up with the
> next upstream release:
> https://gitlab.com/libtiff/libtiff/commit/0356ea76bac908c61160d735f078437ace953bd3
Makes sense to add it now.
New combined diff:
Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/tiff/Makefile,v
retrieving revision 1.89
diff -u -p -r1.89 Makefile
--- Makefile 12 Jul 2019 20:47:10 -0000 1.89
+++ Makefile 28 Nov 2019 18:09:05 -0000
@@ -2,28 +2,28 @@
COMMENT= tools and library routines for working with TIFF images
-DISTNAME= tiff-4.0.10
-SHARED_LIBS= tiff 40.3 # 9.0
-SHARED_LIBS+= tiffxx 40.2 # 9.0
+DISTNAME= tiff-4.1.0
+SHARED_LIBS= tiff 40.4 # 10.0
+SHARED_LIBS+= tiffxx 40.2 # 10.0
CATEGORIES= graphics
MASTER_SITES= https://download.osgeo.org/libtiff/
HOMEPAGE= http://www.simplesystems.org/libtiff/
-LIB_DEPENDS= graphics/jpeg
-WANTLIB= c m ${COMPILER_LIBCXX} z jpeg
+LIB_DEPENDS= graphics/jpeg \
+ archivers/xz \
+ archivers/zstd
+WANTLIB= c ${COMPILER_LIBCXX} jpeg lzma m z zstd
-COMPILER = base-clang ports-gcc base-gcc
+COMPILER = base-clang ports-gcc base-gcc
# BSD
PERMIT_PACKAGE= Yes
CONFIGURE_STYLE=gnu
CONFIGURE_ARGS= --disable-jbig \
- --disable-lzma \
--disable-webp \
- --disable-zstd \
--with-docdir="${PREFIX}/share/doc/tiff" \
--with-jpeg-include-dir="${LOCALBASE}/include" \
--with-jpeg-lib-dir="${LOCALBASE}/lib" \
Index: distinfo
===================================================================
RCS file: /cvs/ports/graphics/tiff/distinfo,v
retrieving revision 1.22
diff -u -p -r1.22 distinfo
--- distinfo 5 Dec 2018 20:35:25 -0000 1.22
+++ distinfo 28 Nov 2019 18:09:05 -0000
@@ -1,2 +1,2 @@
-SHA256 (tiff-4.0.10.tar.gz) = LFLRHMr3Z0V9sMRnldnH0ajY929osLgAo9/kV4a5luQ=
-SIZE (tiff-4.0.10.tar.gz) = 2402867
+SHA256 (tiff-4.1.0.tar.gz) = XSnzJRfa22280SVepbvJOitUuU+/g2U7TWXH1ndbhjQ=
+SIZE (tiff-4.1.0.tar.gz) = 2421581
Index: patches/patch-libtiff_tif_luv_c
===================================================================
RCS file: /cvs/ports/graphics/tiff/patches/patch-libtiff_tif_luv_c,v
retrieving revision 1.8
diff -u -p -r1.8 patch-libtiff_tif_luv_c
--- patches/patch-libtiff_tif_luv_c 26 May 2017 20:50:57 -0000 1.8
+++ patches/patch-libtiff_tif_luv_c 28 Nov 2019 18:09:05 -0000
@@ -2,12 +2,12 @@ $OpenBSD: patch-libtiff_tif_luv_c,v 1.8
Index: libtiff/tif_luv.c
--- libtiff/tif_luv.c.orig
+++ libtiff/tif_luv.c
-@@ -744,7 +744,7 @@ LogLuvEncodeTile(TIFF* tif, uint8* bp, tmsize_t cc, ui
-
- #define itrunc(x,m) ((m)==SGILOGENCODE_NODITHER ? \
- (int)(x) : \
-- (int)((x) + rand()*(1./RAND_MAX) - .5))
-+ (int)((x) + arc4random()*(1./UINT_MAX) - .5))
+@@ -748,7 +748,7 @@ static int itrunc(double x, int m)
+ return (int)x;
+ /* Silence CoverityScan warning about bad crypto function */
+ /* coverity[dont_call] */
+- return (int)(x + rand()*(1./RAND_MAX) - .5);
++ return (int)(x + arc4random()*(1./UINT_MAX) - .5);
+ }
#if !LOGLUV_PUBLIC
- static
Index: patches/patch-libtiff_tif_ojpeg_c
===================================================================
RCS file: patches/patch-libtiff_tif_ojpeg_c
diff -N patches/patch-libtiff_tif_ojpeg_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-libtiff_tif_ojpeg_c 28 Nov 2019 18:09:05 -0000
@@ -0,0 +1,75 @@
+$OpenBSD$
+
+OJPEG: fix broken sanity check added in 4.1.0
+https://gitlab.com/libtiff/libtiff/commit/0356ea76bac908c61160d735f078437ace953bd3
+
+Index: libtiff/tif_ojpeg.c
+--- libtiff/tif_ojpeg.c.orig
++++ libtiff/tif_ojpeg.c
+@@ -837,36 +837,6 @@ OJPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc)
+ {
+ if (sp->subsampling_convert_state==0)
+ {
+- const jpeg_decompress_struct* cinfo = &sp->libjpeg_jpeg_decompress_struct;
+- int width = 0;
+- int last_col_width = 0;
+- int jpeg_bytes;
+- int expected_bytes;
+- int i;
+- if (cinfo->MCUs_per_row == 0)
+- {
+- sp->error_in_raw_data_decoding = 1;
+- return 0;
+- }
+- for (i = 0; i < cinfo->comps_in_scan; ++i)
+- {
+- const jpeg_component_info* info = cinfo->cur_comp_info[i];
+-#if JPEG_LIB_VERSION >= 70
+- width += info->MCU_width * info->DCT_h_scaled_size;
+- last_col_width += info->last_col_width * info->DCT_h_scaled_size;
+-#else
+- width += info->MCU_width * info->DCT_scaled_size;
+- last_col_width += info->last_col_width * info->DCT_scaled_size;
+-
No comments:
Post a Comment