From owner-dev-commits-ports-all@freebsd.org Sat May 8 09:57:30 2021 Return-Path: Delivered-To: dev-commits-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23C9562FE62; Sat, 8 May 2021 09:57:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FcjRG013kz4jM6; Sat, 8 May 2021 09:57:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD1231CC41; Sat, 8 May 2021 09:57:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1489vTqt001422; Sat, 8 May 2021 09:57:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1489vTik001421; Sat, 8 May 2021 09:57:29 GMT (envelope-from git) Date: Sat, 8 May 2021 09:57:29 GMT Message-Id: <202105080957.1489vTik001421@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Matthias Andree Subject: git: c7c4443de742 - main - graphics/openexr: C++14->C++11, overflow fix MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mandree X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c7c4443de74232cbf721b66afeb36412574d6696 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 May 2021 09:57:30 -0000 The branch main has been updated by mandree: URL: https://cgit.FreeBSD.org/ports/commit/?id=c7c4443de74232cbf721b66afeb36412574d6696 commit c7c4443de74232cbf721b66afeb36412574d6696 Author: Matthias Andree AuthorDate: 2021-05-08 09:54:32 +0000 Commit: Matthias Andree CommitDate: 2021-05-08 09:54:32 +0000 graphics/openexr: C++14->C++11, overflow fix Cherry-pick an upstream fix to relax users to C++11, only the OpenEXR code itself requires C++14. Cherry-pick an upstream fix to prevent overflow in getScanlineChunkOffsetTableSize. While here, rename MAJORVER to _MAJORVER as portclippy cleanup. --- graphics/openexr/Makefile | 7 +++-- graphics/openexr/files/patch-549a0835deb | 46 ++++++++++++++++++++++++++++++++ graphics/openexr/files/patch-61d209bfd8d | 35 ++++++++++++++++++++++++ 3 files changed, 86 insertions(+), 2 deletions(-) diff --git a/graphics/openexr/Makefile b/graphics/openexr/Makefile index 4154da66974b..0114528d230d 100644 --- a/graphics/openexr/Makefile +++ b/graphics/openexr/Makefile @@ -2,6 +2,7 @@ PORTNAME= openexr PORTVERSION= 3.0.1 +PORTREVISION= 1 CATEGORIES= graphics devel MASTER_SITES= LOCAL/mandree/:test DISTFILES= ${PORTNAME}-2.2.0-comp_dwa-test-images.tar.xz:test @@ -25,12 +26,14 @@ CPPFLAGS+= -I. -I../IlmImf # must be linked with -l{thr|pthread} explicitly LDFLAGS+= -lpthread -MAJORVER= 3_0 +PATCH_STRIP= -p1 + +_MAJORVER= 3_0 _VER= 27 _MINVER= 0 _PLVER= 0 -PLIST_SUB+= MAJORVER=${MAJORVER} \ +PLIST_SUB+= MAJORVER=${_MAJORVER} \ VER=${_VER} \ MINVER=${_MINVER} \ PLVER=${_PLVER} diff --git a/graphics/openexr/files/patch-549a0835deb b/graphics/openexr/files/patch-549a0835deb new file mode 100644 index 000000000000..bc34fdaf3bfe --- /dev/null +++ b/graphics/openexr/files/patch-549a0835deb @@ -0,0 +1,46 @@ +From 549a0835deb257f5caf5e54880c2be968e690b83 Mon Sep 17 00:00:00 2001 +From: Larry Gritz +Date: Thu, 8 Apr 2021 15:33:40 -0700 +Subject: [PATCH] Don't impose C++14 on downstream projects (#995) + +We were setting + + target_compile_features(${objlib} PUBLIC cxx_std_${OPENEXR_CXX_STANDARD}) + +The `PUBLIC` forced downstream projects that consume the +`OpenEXRConfig*.cmake` exports to use C++ standard at least as recent +as what OpenEXR used to build (which defaults to 14). + +But this is unnecessary. There's nothing in OpenEXR's headers that +requires anything beyond C++11. So this patch uses a more fine-grained +setting of target properties to express this more correctly. Now it will +be fine for a C++11 project to consume OpenEXR (via its exported configs) +even if that OpenEXR happened to be built with C++14. + +Signed-off-by: Larry Gritz +--- + cmake/LibraryDefine.cmake | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/cmake/LibraryDefine.cmake b/cmake/LibraryDefine.cmake +index 640974291..7ed74da9d 100644 +--- a/cmake/LibraryDefine.cmake ++++ b/cmake/LibraryDefine.cmake +@@ -17,7 +17,16 @@ function(OPENEXR_DEFINE_LIBRARY libname) + ${OPENEXR_CURLIB_HEADERS} + ${OPENEXR_CURLIB_SOURCES}) + +- target_compile_features(${objlib} PUBLIC cxx_std_${OPENEXR_CXX_STANDARD}) ++ # Use ${OPENEXR_CXX_STANDARD} to determine the standard we use to compile ++ # OpenEXR itself. But the headers only require C++11 features, so that's ++ # all we need to pass on as interface reqirements to downstream projects. ++ # For example, it's fine for an OpenEXR built with C++14 to be called from ++ # an app that is compiled with C++11; OpenEXR needn't force the app to ++ # also use C++14. ++ target_compile_features(${objlib} ++ PRIVATE cxx_std_${OPENEXR_CXX_STANDARD} ++ INTERFACE cxx_std_11 ) ++ + if(OPENEXR_CURLIB_PRIV_EXPORT AND BUILD_SHARED_LIBS) + target_compile_definitions(${objlib} PRIVATE ${OPENEXR_CURLIB_PRIV_EXPORT}) + if(WIN32) diff --git a/graphics/openexr/files/patch-61d209bfd8d b/graphics/openexr/files/patch-61d209bfd8d new file mode 100644 index 000000000000..6800a1ce3c56 --- /dev/null +++ b/graphics/openexr/files/patch-61d209bfd8d @@ -0,0 +1,35 @@ +From 61d209bfd8daefc758735cd20ccff977f98b49a0 Mon Sep 17 00:00:00 2001 +From: peterhillman +Date: Sat, 8 May 2021 12:02:38 +1200 +Subject: [PATCH] Prevent overflow in getScanlineChunkOffsetTableSize (#1003) + +Signed-off-by: Peter Hillman +--- + src/lib/OpenEXR/ImfMisc.cpp | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/src/lib/OpenEXR/ImfMisc.cpp b/src/lib/OpenEXR/ImfMisc.cpp +index a65e2a3f4..80c8ce8d2 100644 +--- a/src/lib/OpenEXR/ImfMisc.cpp ++++ b/src/lib/OpenEXR/ImfMisc.cpp +@@ -1828,12 +1828,17 @@ getScanlineChunkOffsetTableSize(const Header& header) + { + const Box2i &dataWindow = header.dataWindow(); + +- int linesInBuffer = numLinesInBuffer ( header.compression() ); + +- int lineOffsetSize = (dataWindow.max.y - dataWindow.min.y + ++ // ++ // use int64_t types to prevent overflow in lineOffsetSize for images with ++ // extremely high dataWindows ++ // ++ int64_t linesInBuffer = numLinesInBuffer ( header.compression() ); ++ ++ int64_t lineOffsetSize = (static_cast (dataWindow.max.y) - static_cast (dataWindow.min.y) + + linesInBuffer) / linesInBuffer; + +- return lineOffsetSize; ++ return static_cast (lineOffsetSize); + } + + //