diff options
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/libraw/Makefile | 13 | ||||
-rw-r--r-- | graphics/libraw/buildlink3.mk | 4 | ||||
-rw-r--r-- | graphics/libraw/distinfo | 15 | ||||
-rw-r--r-- | graphics/libraw/patches/patch-internal_libraw__x3f.cpp | 16 | ||||
-rw-r--r-- | graphics/libraw/patches/patch-libraw__r.pc.in | 6 | ||||
-rw-r--r-- | graphics/libraw/patches/patch-libraw_libraw__const.h | 18 | ||||
-rw-r--r-- | graphics/libraw/patches/patch-src_libraw__cxx.cpp | 130 |
7 files changed, 14 insertions, 188 deletions
diff --git a/graphics/libraw/Makefile b/graphics/libraw/Makefile index b7f899a8955..7a2e2469870 100644 --- a/graphics/libraw/Makefile +++ b/graphics/libraw/Makefile @@ -1,8 +1,7 @@ -# $NetBSD: Makefile,v 1.35 2021/09/19 18:46:50 nia Exp $ +# $NetBSD: Makefile,v 1.36 2021/09/28 09:59:24 nia Exp $ -DISTNAME= LibRaw-0.19.5 +DISTNAME= LibRaw-0.20.2 PKGNAME= ${DISTNAME:tl} -PKGREVISION= 1 CATEGORIES= graphics MASTER_SITES= https://www.libraw.org/data/ @@ -11,7 +10,7 @@ HOMEPAGE= https://www.libraw.org/ COMMENT= Raw decoding/processing library LICENSE= gnu-lgpl-v2.1 OR cddl-1.0 -USE_LANGUAGES= c c++03 +USE_LANGUAGES= c c++ USE_LIBTOOL= yes USE_TOOLS+= pkg-config gmake GNU_CONFIGURE= yes @@ -20,12 +19,6 @@ CONFIGURE_ARGS+= --disable-examples PKGCONFIG_OVERRIDE+= libraw.pc.in PKGCONFIG_OVERRIDE+= libraw_r.pc.in -# internal/dcraw_common.cpp: In member function 'void LibRaw::xtrans_interpolate(int)': -# internal/dcraw_common.cpp:5885:27: error: array subscript has type 'char' [-Werror=char-subscripts] -# cstat[fcol(row, col)]++; -# Maybe fix this later. -BUILDLINK_TRANSFORM+= rm:-Werror=char-subscripts - .include "options.mk" .include "../../graphics/lcms2/buildlink3.mk" .include "../../mk/jpeg.buildlink3.mk" diff --git a/graphics/libraw/buildlink3.mk b/graphics/libraw/buildlink3.mk index 2ef9fa98c36..b6ee0b7f88b 100644 --- a/graphics/libraw/buildlink3.mk +++ b/graphics/libraw/buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: buildlink3.mk,v 1.9 2020/03/15 10:31:59 rillig Exp $ +# $NetBSD: buildlink3.mk,v 1.10 2021/09/28 09:59:24 nia Exp $ BUILDLINK_TREE+= libraw @@ -11,7 +11,7 @@ BUILDLINK_PKGSRCDIR.libraw?= ../../graphics/libraw pkgbase := libraw .include "../../mk/pkg-build-options.mk" -.if !empty(PKG_BUILD_OPTIONS.libraw:Mjasper) +.if ${PKG_BUILD_OPTIONS.libraw:Mjasper} . include "../../graphics/jasper/buildlink3.mk" .endif .include "../../graphics/lcms2/buildlink3.mk" diff --git a/graphics/libraw/distinfo b/graphics/libraw/distinfo index df406deec87..7d646a49983 100644 --- a/graphics/libraw/distinfo +++ b/graphics/libraw/distinfo @@ -1,10 +1,7 @@ -$NetBSD: distinfo,v 1.27 2021/09/19 18:46:50 nia Exp $ +$NetBSD: distinfo,v 1.28 2021/09/28 09:59:24 nia Exp $ -SHA1 (LibRaw-0.19.5.tar.gz) = c151995b6f17a0ccef7fbc1dcb982f0ccb04d934 -RMD160 (LibRaw-0.19.5.tar.gz) = 051642cfdf713e1d981a1790f4d872d89ff6f02a -SHA512 (LibRaw-0.19.5.tar.gz) = 4560045f75e6d2ab0d1d8686075f3a0e26a5d7ce693b48508110a2c31d19055d58983c24852da0abb64fa90db5e20f24b87aa7537ed04d958c38c8b265a7e826 -Size (LibRaw-0.19.5.tar.gz) = 1303806 bytes -SHA1 (patch-internal_libraw__x3f.cpp) = ec5d479a45d7fc25c884cc7259ad513857fa2711 -SHA1 (patch-libraw__r.pc.in) = e691f79c69c5530c93262c270fe7e2f5b1c959d9 -SHA1 (patch-libraw_libraw__const.h) = 91836dca7f9ba820417381bad53fe292b3e5f0ce -SHA1 (patch-src_libraw__cxx.cpp) = fb2f16cb7a0798f499383bc06768ac0543049f66 +SHA1 (LibRaw-0.20.2.tar.gz) = 8143597d820167fb4f3a51c920e142e6f1386d01 +RMD160 (LibRaw-0.20.2.tar.gz) = 932abbfd49432ace0a2e2b4e4fbb07f140421de3 +SHA512 (LibRaw-0.20.2.tar.gz) = 96b1aaf09e2d46448d1b3619270c1f1c32e9bcbd866567cec67d5b1f889362f0fae3f3533ea9bf6a11a917be3b61ee6c9938bad09209d93453039ed04eaeae4a +Size (LibRaw-0.20.2.tar.gz) = 1432141 bytes +SHA1 (patch-libraw__r.pc.in) = 6ad890804132306c878657a31998f70d92f8b185 diff --git a/graphics/libraw/patches/patch-internal_libraw__x3f.cpp b/graphics/libraw/patches/patch-internal_libraw__x3f.cpp deleted file mode 100644 index c8f17ed5dbf..00000000000 --- a/graphics/libraw/patches/patch-internal_libraw__x3f.cpp +++ /dev/null @@ -1,16 +0,0 @@ -$NetBSD: patch-internal_libraw__x3f.cpp,v 1.2 2018/04/14 03:45:56 markd Exp $ - -undefine DS if sys/regset.h is pulled in on SunOS - ---- internal/libraw_x3f.cpp.orig 2018-02-24 09:47:43.000000000 +0000 -+++ internal/libraw_x3f.cpp -@@ -710,6 +710,9 @@ static x3f_huffman_t *new_huffman(x3f_hu - /* --------------------------------------------------------------------- */ - /* Creating a new x3f structure from file */ - /* --------------------------------------------------------------------- */ -+#ifdef DS -+#undef DS -+#endif - - /* extern */ x3f_t *x3f_new_from_file(LibRaw_abstract_datastream *infile) - { diff --git a/graphics/libraw/patches/patch-libraw__r.pc.in b/graphics/libraw/patches/patch-libraw__r.pc.in index 4e01db7b92f..bb144ed4d46 100644 --- a/graphics/libraw/patches/patch-libraw__r.pc.in +++ b/graphics/libraw/patches/patch-libraw__r.pc.in @@ -1,8 +1,8 @@ -$NetBSD: patch-libraw__r.pc.in,v 1.2 2015/07/18 10:40:20 adam Exp $ +$NetBSD: patch-libraw__r.pc.in,v 1.3 2021/09/28 09:59:24 nia Exp $ Avoid libstdc++. ---- libraw_r.pc.in.orig 2013-05-17 22:56:40.000000000 +0000 +--- libraw_r.pc.in.orig 2020-10-15 05:06:07.000000000 +0000 +++ libraw_r.pc.in @@ -7,5 +7,5 @@ Name: libraw Description: Raw image decoder library (thread-safe) @@ -10,4 +10,4 @@ Avoid libstdc++. Version: @PACKAGE_VERSION@ -Libs: -L${libdir} -lraw_r -lstdc++@PC_OPENMP@ +Libs: -L${libdir} -lraw_r @PC_OPENMP@ - Cflags: -I${includedir}/libraw + Cflags: -I${includedir}/libraw -I${includedir} diff --git a/graphics/libraw/patches/patch-libraw_libraw__const.h b/graphics/libraw/patches/patch-libraw_libraw__const.h deleted file mode 100644 index 29b7dc9ee49..00000000000 --- a/graphics/libraw/patches/patch-libraw_libraw__const.h +++ /dev/null @@ -1,18 +0,0 @@ -$NetBSD: patch-libraw_libraw__const.h,v 1.1 2021/09/19 18:46:50 nia Exp $ - -Thumbnail size range check (CVE-2020-15503) - ---- libraw/libraw_const.h.orig 2019-08-20 17:34:30.000000000 +0000 -+++ libraw/libraw_const.h -@@ -24,6 +24,11 @@ it under the terms of the one of two lic - #define LIBRAW_MAX_ALLOC_MB 2048L - #endif - -+/* limit thumbnail size, default is 512Mb*/ -+#ifndef LIBRAW_MAX_THUMBNAIL_MB -+#define LIBRAW_MAX_THUMBNAIL_MB 512L -+#endif -+ - /* Change to non-zero to allow (broken) CRW (and other) files metadata - loop prevention */ - #ifndef LIBRAW_METADATA_LOOP_PREVENTION diff --git a/graphics/libraw/patches/patch-src_libraw__cxx.cpp b/graphics/libraw/patches/patch-src_libraw__cxx.cpp deleted file mode 100644 index e4bffc8f458..00000000000 --- a/graphics/libraw/patches/patch-src_libraw__cxx.cpp +++ /dev/null @@ -1,130 +0,0 @@ -$NetBSD: patch-src_libraw__cxx.cpp,v 1.2 2021/09/19 18:46:50 nia Exp $ - -- Thumbnail size range check (CVE-2020-15503) -- undefine DS if sys/regset.h is pulled in on SunOS - ---- src/libraw_cxx.cpp.orig 2019-08-20 17:34:30.000000000 +0000 -+++ src/libraw_cxx.cpp -@@ -3712,6 +3712,20 @@ libraw_processed_image_t *LibRaw::dcraw_ - return NULL; - } - -+ if (T.tlength < 64u) -+ { -+ if (errcode) -+ *errcode = EINVAL; -+ return NULL; -+ } -+ -+ if (INT64(T.tlength) > 1024ULL * 1024ULL * LIBRAW_MAX_THUMBNAIL_MB) -+ { -+ if (errcode) -+ *errcode = LIBRAW_TOO_BIG; -+ return NULL; -+ } -+ - if (T.tformat == LIBRAW_THUMBNAIL_BITMAP) - { - libraw_processed_image_t *ret = (libraw_processed_image_t *)::malloc(sizeof(libraw_processed_image_t) + T.tlength); -@@ -3976,6 +3990,12 @@ void LibRaw::kodak_thumb_loader() - if (ID.toffset + est_datasize > ID.input->size() + THUMB_READ_BEYOND) - throw LIBRAW_EXCEPTION_IO_EOF; - -+ if(INT64(T.theight) * INT64(T.twidth) > 1024ULL * 1024ULL * LIBRAW_MAX_THUMBNAIL_MB) -+ throw LIBRAW_EXCEPTION_IO_CORRUPT; -+ -+ if (INT64(T.theight) * INT64(T.twidth) < 64ULL) -+ throw LIBRAW_EXCEPTION_IO_CORRUPT; -+ - // some kodak cameras - ushort s_height = S.height, s_width = S.width, s_iwidth = S.iwidth, s_iheight = S.iheight; - ushort s_flags = libraw_internal_data.unpacker_data.load_flags; -@@ -4237,6 +4257,25 @@ int LibRaw::unpack_thumb(void) - CHECK_ORDER_LOW(LIBRAW_PROGRESS_IDENTIFY); - CHECK_ORDER_BIT(LIBRAW_PROGRESS_THUMB_LOAD); - -+#define THUMB_SIZE_CHECKT(A) \ -+ do { \ -+ if (INT64(A) > 1024ULL * 1024ULL * LIBRAW_MAX_THUMBNAIL_MB) throw LIBRAW_EXCEPTION_IO_CORRUPT; \ -+ if (INT64(A) > 0 && INT64(A) < 64ULL) throw LIBRAW_EXCEPTION_IO_CORRUPT; \ -+ } while (0) -+ -+#define THUMB_SIZE_CHECKTNZ(A) \ -+ do { \ -+ if (INT64(A) > 1024ULL * 1024ULL * LIBRAW_MAX_THUMBNAIL_MB) throw LIBRAW_EXCEPTION_IO_CORRUPT; \ -+ if (INT64(A) < 64ULL) throw LIBRAW_EXCEPTION_IO_CORRUPT; \ -+ } while (0) -+ -+ -+#define THUMB_SIZE_CHECKWH(W,H) \ -+ do { \ -+ if (INT64(W)*INT64(H) > 1024ULL * 1024ULL * LIBRAW_MAX_THUMBNAIL_MB) throw LIBRAW_EXCEPTION_IO_CORRUPT; \ -+ if (INT64(W)*INT64(H) < 64ULL) throw LIBRAW_EXCEPTION_IO_CORRUPT; \ -+ } while (0) -+ - try - { - if (!libraw_internal_data.internal_data.input) -@@ -4267,6 +4306,7 @@ int LibRaw::unpack_thumb(void) - - if (INT64(ID.toffset) + tsize > ID.input->size() + THUMB_READ_BEYOND) - throw LIBRAW_EXCEPTION_IO_EOF; -+ THUMB_SIZE_CHECKT(tsize); - } - else - { -@@ -4280,6 +4320,8 @@ int LibRaw::unpack_thumb(void) - ID.input->seek(ID.toffset, SEEK_SET); - if (write_thumb == &LibRaw::jpeg_thumb) - { -+ THUMB_SIZE_CHECKTNZ(T.tlength); -+ - if (T.thumb) - free(T.thumb); - T.thumb = (char *)malloc(T.tlength); -@@ -4326,6 +4368,7 @@ int LibRaw::unpack_thumb(void) - { - if (t_bytesps > 1) - throw LIBRAW_EXCEPTION_IO_CORRUPT; // 8-bit thumb, but parsed for more bits -+ THUMB_SIZE_CHECKWH(T.twidth, T.theight); - int t_length = T.twidth * T.theight * t_colors; - - if (T.tlength && T.tlength < t_length) // try to find tiff ifd with needed offset -@@ -4351,6 +4394,7 @@ int LibRaw::unpack_thumb(void) - T.tcolors = 1; - } - T.tlength = total_size; -+ THUMB_SIZE_CHECKTNZ(T.tlength); - if (T.thumb) - free(T.thumb); - T.thumb = (char *)malloc(T.tlength); -@@ -4384,6 +4428,8 @@ int LibRaw::unpack_thumb(void) - if (T.thumb) - free(T.thumb); - -+ THUMB_SIZE_CHECKTNZ(T.tlength); -+ - T.thumb = (char *)malloc(T.tlength); - if (!T.tcolors) - T.tcolors = t_colors; -@@ -4404,6 +4450,10 @@ int LibRaw::unpack_thumb(void) - int i_length = T.twidth * T.theight * t_colors * 2; - if (!T.tlength) - T.tlength = o_length; -+ THUMB_SIZE_CHECKTNZ(o_length); -+ THUMB_SIZE_CHECKTNZ(i_length); -+ THUMB_SIZE_CHECKTNZ(T.tlength); -+ - ushort *t_thumb = (ushort *)calloc(i_length, 1); - ID.input->read(t_thumb, 1, i_length); - if ((libraw_internal_data.unpacker_data.order == 0x4949) == (ntohs(0x1234) == 0x1234)) -@@ -6183,6 +6233,9 @@ void LibRaw::parse_x3f() - _x3f_data = x3f; - - x3f_header_t *H = NULL; -+#ifdef DS -+#undef DS -+#endif - x3f_directory_section_t *DS = NULL; - - H = &x3f->header; |