From nobody Tue Sep 19 18:27:21 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Rqqrn6PPwz4m5WZ; Tue, 19 Sep 2023 18:27:21 +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 4Rqqrn5jm0z3Nyn; Tue, 19 Sep 2023 18:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695148041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vddFyci1BiJdrGpTR7v4ebaN5cB6wKoyxXRZn1ewGVg=; b=QANJLaG5yEG0onP5WU6MuyC016abcXzxxK9JaGVqGQaVp1vDI43zp2jbZ53ACvR2LEJ6fj LqCo3Rk1zoVTgEspyFEFkkFcW+BiQ4B8W5ivfH5bXKNi5qXFP8uHVtNWShZsCZZRvt51Uq V7eVv1Upf9ilWJ3VtaNSgZaB7BeyJMZ++vlcZ5/vcmeWWgFcurgtCt2Syqr7LWLbp2mTnf krEwQoYhHBvrZmWkjTaMwT6MqmTdhKtacrMFw2tTtc8+uHWwpQ3mCZABqFJVm8QuxC0QJA FyPCM5PQwFd/9R3ZjPuea37WA+zXhhI1owHxJOYCDM20Xl/WnUEXZwqFI/r/Fg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695148041; a=rsa-sha256; cv=none; b=iWbdLqdSk1468wyiVfXoSv6iy/T7UN1b+TsKT1+/iOLVmIzYprG0ZgYOQR7RYY2M5nzUZV kRp5leEaK/VLI2r4ngTddNueOLyJ5nU2tqKHODZY0YrrYhe075aXIlse7QMxUV3V5y0gBc tQtRiGVEKNOAdbnKQFeHtGHzhuRgqvEMrQWBGCGN6bOdL0ERJJhG5OiWKmYWU2Xs7fN86J L1Gei1nXn6QPHKOtjH/WFuLWI7Vfgx9fwxMCpQgqHPwj1SLdOIyID7aIuoycD6/UsFZDEz JOz0XoQuHRQ1OK2EvOcJzt766FjxsMiSFqu5Om4ZWMgSxuH/zc/01yoCy4BIrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695148041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vddFyci1BiJdrGpTR7v4ebaN5cB6wKoyxXRZn1ewGVg=; b=rQvwJ0OL+JcHm19ur015TR5D4cl+GcQvlxrny1Lt2M6IBU+QoF3o5Jqai7EJmSOg9muTrx 7JuYXzH4z528SwcHGqGxUlWIepUqhH30gam3ckwpjWDOEpJA35QjlAKWKEtDRIK/9WRY3H inM17T2pbYTGzOQoU6TWk1GsM/QWUrKLDwD2SoyXUA9YJFpUgLS8hAPEiYxRXG0p6WR3KH AbzMwvvQDyoBKZytTk42azUpk/xc/f8jhzMTG5w30nEEr1jMJoomrikxkcQIgxWJUV8b2I 18OMXA3VXzxxhV+U456vUN+5FUI/LqGD4cgftDog9VUkCtlTnTxWdoi2Agt/dA== 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 4Rqqrn4q96z8fr; Tue, 19 Sep 2023 18:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38JIRLxl092191; Tue, 19 Sep 2023 18:27:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38JIRLVX092188; Tue, 19 Sep 2023 18:27:21 GMT (envelope-from git) Date: Tue, 19 Sep 2023 18:27:21 GMT Message-Id: <202309191827.38JIRLVX092188@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Daniel Engberg Subject: git: 0831c69cb760 - main - devel/woff2: Improve port and import patches List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: diizzy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0831c69cb760af830dd3453ef779947f6d65e605 Auto-Submitted: auto-generated The branch main has been updated by diizzy: URL: https://cgit.FreeBSD.org/ports/commit/?id=0831c69cb760af830dd3453ef779947f6d65e605 commit 0831c69cb760af830dd3453ef779947f6d65e605 Author: Daniel Engberg AuthorDate: 2023-09-19 18:23:06 +0000 Commit: Daniel Engberg CommitDate: 2023-09-19 18:23:10 +0000 devel/woff2: Improve port and import patches - Import Coverity Scan patch from Fedora - Disable RPATH - Backport upstream commit 3831354113db8803fb1f5ba196cf0bbb537578dd - Add USES= pathfix and pkgconfig References: https://src.fedoraproject.org/rpms/woff2/blob/rawhide/f/covscan.patch https://github.com/google/woff2/commit/3831354113db8803fb1f5ba196cf0bbb537578dd PR: 273510 Approved by: portmgr (maintainer timeout, 2+ weeks) Sponsored by: Blinkinblox --- devel/woff2/Makefile | 9 +- devel/woff2/distinfo | 4 +- devel/woff2/files/patch-coverity_scan | 164 ++++++++++++++++++++++++++++++++++ 3 files changed, 174 insertions(+), 3 deletions(-) diff --git a/devel/woff2/Makefile b/devel/woff2/Makefile index 261f38b9e39f..dd3d4c73e6b0 100644 --- a/devel/woff2/Makefile +++ b/devel/woff2/Makefile @@ -1,9 +1,12 @@ PORTNAME= woff2 DISTVERSIONPREFIX= v DISTVERSION= 1.0.2 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= devel +PATCH_SITES= https://github.com/google/${PORTNAME}/commit/ +PATCHFILES= 3831354113db8803fb1f5ba196cf0bbb537578dd.patch:-p1 + MAINTAINER= gnome@FreeBSD.org COMMENT= Library and converter tools for the WOFF 2.0 web font format WWW= https://github.com/google/woff2 @@ -13,11 +16,13 @@ LICENSE_FILE= ${WRKSRC}/LICENSE LIB_DEPENDS= libbrotlidec.so:archivers/brotli -USES= cmake compiler:c++11-lib +USES= cmake compiler:c++11-lib pathfix pkgconfig USE_GITHUB= yes GH_ACCOUNT= google USE_LDCONFIG= yes PLIST_SUB= SHLIBVER=${DISTVERSION} +CMAKE_ON= CMAKE_SKIP_RPATH + .include diff --git a/devel/woff2/distinfo b/devel/woff2/distinfo index ef264719fcff..b056f86d4730 100644 --- a/devel/woff2/distinfo +++ b/devel/woff2/distinfo @@ -1,3 +1,5 @@ -TIMESTAMP = 1522147257 +TIMESTAMP = 1693634674 SHA256 (google-woff2-v1.0.2_GH0.tar.gz) = add272bb09e6384a4833ffca4896350fdb16e0ca22df68c0384773c67a175594 SIZE (google-woff2-v1.0.2_GH0.tar.gz) = 38934 +SHA256 (3831354113db8803fb1f5ba196cf0bbb537578dd.patch) = 28a197486d60897b856ea9706c5a136dc9dc284fbc8db71f5a4367700eefef2e +SIZE (3831354113db8803fb1f5ba196cf0bbb537578dd.patch) = 1519 diff --git a/devel/woff2/files/patch-coverity_scan b/devel/woff2/files/patch-coverity_scan new file mode 100644 index 000000000000..d72690fa8b83 --- /dev/null +++ b/devel/woff2/files/patch-coverity_scan @@ -0,0 +1,164 @@ +diff --git a/src/font.cc b/src/font.cc +index a45153e..0e9f5bf 100644 +--- src/font.cc ++++ src/font.cc +@@ -66,7 +66,7 @@ bool ReadTrueTypeFont(Buffer* file, const uint8_t* data, size_t len, + + std::map intervals; + for (uint16_t i = 0; i < font->num_tables; ++i) { +- Font::Table table; ++ Font::Table table = {}; + table.flag_byte = 0; + table.reuse_of = NULL; + if (!file->ReadU32(&table.tag) || +@@ -326,7 +326,7 @@ int NumGlyphs(const Font& font) { + return 0; + } + int index_fmt = IndexFormat(font); +- int loca_record_size = (index_fmt == 0 ? 2 : 4); ++ uint32_t loca_record_size = (index_fmt == 0 ? 2 : 4); + if (loca_table->length < loca_record_size) { + return 0; + } +diff --git a/src/glyph.h b/src/glyph.h +index f24056f..e870188 100644 +--- src/glyph.h ++++ src/glyph.h +@@ -22,17 +22,17 @@ namespace woff2 { + // is around. + class Glyph { + public: +- Glyph() : instructions_size(0), composite_data_size(0) {} ++ Glyph() {} + + // Bounding box. +- int16_t x_min; +- int16_t x_max; +- int16_t y_min; +- int16_t y_max; ++ int16_t x_min = 0; ++ int16_t x_max = 0; ++ int16_t y_min = 0; ++ int16_t y_max = 0; + + // Instructions. +- uint16_t instructions_size; +- const uint8_t* instructions_data; ++ uint16_t instructions_size = 0; ++ const uint8_t* instructions_data = 0; + + // Data model for simple glyphs. + struct Point { +@@ -43,9 +43,9 @@ class Glyph { + std::vector > contours; + + // Data for composite glyphs. +- const uint8_t* composite_data; +- uint32_t composite_data_size; +- bool have_instructions; ++ const uint8_t* composite_data = 0; ++ uint32_t composite_data_size = 0; ++ bool have_instructions = false; + }; + + // Parses the glyph from the given data. Returns false on parsing failure or +diff --git a/src/normalize.cc b/src/normalize.cc +index 6685e08..a819074 100644 +--- src/normalize.cc ++++ src/normalize.cc +@@ -97,7 +97,7 @@ bool MakeEditableBuffer(Font* font, int tableTag) { + table->buffer.resize(sz); + uint8_t* buf = &table->buffer[0]; + memcpy(buf, table->data, table->length); +- if (PREDICT_FALSE(sz > table->length)) { ++ if (PREDICT_FALSE(static_cast(sz) > table->length)) { + memset(buf + table->length, 0, sz - table->length); + } + table->data = buf; +@@ -213,7 +213,6 @@ bool FixChecksums(Font* font) { + size_t offset = 8; + StoreU32(0, &offset, head_buf); + uint32_t file_checksum = 0; +- uint32_t head_checksum = 0; + for (auto& i : font->tables) { + Font::Table* table = &i.second; + if (table->IsReused()) { +@@ -221,10 +220,6 @@ bool FixChecksums(Font* font) { + } + table->checksum = ComputeULongSum(table->data, table->length); + file_checksum += table->checksum; +- +- if (table->tag == kHeadTableTag) { +- head_checksum = table->checksum; +- } + } + + file_checksum += ComputeHeaderChecksum(*font); +diff --git a/src/woff2_dec.cc b/src/woff2_dec.cc +index 25e18c6..442baa5 100644 +--- src/woff2_dec.cc ++++ src/woff2_dec.cc +@@ -316,7 +316,7 @@ void ComputeBbox(unsigned int n_points, const Point* points, uint8_t* dst) { + offset = Store16(dst, offset, x_min); + offset = Store16(dst, offset, y_min); + offset = Store16(dst, offset, x_max); +- offset = Store16(dst, offset, y_max); ++ Store16(dst, offset, y_max); + } + + +diff --git a/src/woff2_enc.cc b/src/woff2_enc.cc +index ec00878..c0598f8 100644 +--- src/woff2_enc.cc ++++ src/woff2_enc.cc +@@ -331,20 +331,17 @@ bool ConvertTTFToWOFF2(const uint8_t *data, size_t length, + return false; + } + +- Table table; ++ Table table = {}; + table.tag = src_table.tag; + table.flags = src_table.flag_byte; + table.src_length = src_table.length; + table.transform_length = src_table.length; +- const uint8_t* transformed_data = src_table.data; + const Font::Table* transformed_table = + font.FindTable(src_table.tag ^ 0x80808080); + if (transformed_table != NULL) { + table.flags = transformed_table->flag_byte; + table.flags |= kWoff2FlagsTransform; + table.transform_length = transformed_table->length; +- transformed_data = transformed_table->data; +- + } + tables.push_back(table); + } +@@ -423,8 +420,6 @@ bool ConvertTTFToWOFF2(const uint8_t *data, size_t length, + // for reused tables, only the original has an updated offset + uint32_t table_offset = + table.IsReused() ? table.reuse_of->offset : table.offset; +- uint32_t table_length = +- table.IsReused() ? table.reuse_of->length : table.length; + std::pair tag_offset(table.tag, table_offset); + if (index_by_tag_offset.find(tag_offset) == index_by_tag_offset.end()) { + #ifdef FONT_COMPRESSION_BIN +diff --git a/src/woff2_info.cc b/src/woff2_info.cc +index 2b51adc..8ec9d36 100644 +--- src/woff2_info.cc ++++ src/woff2_info.cc +@@ -122,13 +122,13 @@ int main(int argc, char **argv) { + if (!woff2::Read255UShort(&file, &numFonts)) return 1; + printf("CollectionHeader 0x%08x %d fonts\n", version, numFonts); + +- for (auto i = 0; i < numFonts; i++) { ++ for (auto i = 0u; i < numFonts; i++) { + uint32_t numTables, flavor; + if (!woff2::Read255UShort(&file, &numTables)) return 1; + if (!file.ReadU32(&flavor)) return 1; + printf("CollectionFontEntry %d flavor 0x%08x %d tables\n", i, flavor, + numTables); +- for (auto j = 0; j < numTables; j++) { ++ for (auto j = 0u; j < numTables; j++) { + uint32_t table_idx; + if (!woff2::Read255UShort(&file, &table_idx)) return 1; + if (table_idx >= table_tags.size()) return 1;