external/freetype/ExternalProject_freetype.mk |    2 +-
 external/freetype/freetype-fd-hack.patch.0    |    8 ++++++++
 external/freetype/ubsan.patch                 |   13 ++++++++++++-
 3 files changed, 21 insertions(+), 2 deletions(-)

New commits:
commit 777fdb0378d135499962ac7ba6b2ae4fc37db068
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Fri Feb 10 11:15:21 2023 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 8 20:59:58 2023 +0100

    Avoid implicit function declaration warnings
    
    Noticed when compiling with Emscripten for WASM, but might well happen
    in other cases, too.
    
    Change-Id: I37ae326af21204d81a6a3267831d7a0198d1d501
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146744
    Tested-by: Tor Lillqvist <t...@collabora.com>
    Reviewed-by: Tor Lillqvist <t...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147531

diff --git a/external/freetype/freetype-fd-hack.patch.0 
b/external/freetype/freetype-fd-hack.patch.0
index db2bdc9e92f6..c12d6739fc4c 100644
--- a/external/freetype/freetype-fd-hack.patch.0
+++ b/external/freetype/freetype-fd-hack.patch.0
@@ -1,6 +1,14 @@
 # -*- Mode: Diff -*-
 --- src/base/ftsystem.c
 +++ src/base/ftsystem.c
+@@ -24,6 +24,7 @@
+    *
+    */
+ 
++#include <unistd.h>
+ 
+ #include <ft2build.h>
+ #include FT_CONFIG_CONFIG_H
 @@ -237,6 +237,8 @@
                    const char*  filepathname )
    {
commit 62ef1dd55913f8cf03156249ef46b090c38fbab1
Author:     Andras Timar <andras.ti...@collabora.com>
AuthorDate: Wed Mar 8 20:58:14 2023 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 8 20:58:14 2023 +0100

    [cp] freetype: sync ubsan.patch with co-23.05
    
    Change-Id: If6d3276f86c11bdd165c0587b547d371c2c4c5af

diff --git a/external/freetype/ubsan.patch b/external/freetype/ubsan.patch
index 6a7688139ae8..b27bbba09cb8 100644
--- a/external/freetype/ubsan.patch
+++ b/external/freetype/ubsan.patch
@@ -1,3 +1,14 @@
+--- src/truetype/ttgxvar.c
++++ src/truetype/ttgxvar.c
+@@ -964,7 +964,7 @@
+     /* in the OpenType specification.                  */
+ 
+     varData  = &itemStore->varData[outerIndex];
+-    deltaSet = &varData->deltaSet[varData->regionIdxCount * innerIndex];
++    deltaSet = varData->regionIdxCount * innerIndex == 0 ? varData->deltaSet 
: &varData->deltaSet[varData->regionIdxCount * innerIndex];
+ 
+     /* outer loop steps through master designs to be blended */
+     for ( master = 0; master < varData->regionIdxCount; master++ )
 --- src/psaux/psobjs.c.orig    2022-11-17 16:52:21.913211573 +0100
 +++ src/psaux/psobjs.c 2022-11-17 16:53:17.905127207 +0100
 @@ -201,7 +201,8 @@
commit ed83e5150ad1ed6ffab4f76f10e775907984bb62
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Wed Nov 23 08:13:44 2022 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 8 20:54:20 2023 +0100

    exteral/freetype: improve -fsanitize=non-null-attribute fix
    
    Quoting 
<https://gerrit.libreoffice.org/c/core/+/143098/2#message-62ac4499370dd88eeb3181f52d817e831150c94d>:
    
    > What we do in other such cases is not make it conditional on the
    > pointer argument being non-null, but rather make it conditional on the
    > length argument not being zero.  That way, it only catches the
    > "harmless" case of an "irrelevant" null pointer in combination with a
    > zero length, and doesn't hide bugs where the pointer is erroneously null
    > while the length is non-zero.
    
    So check for the length and not for the pointer argument.
    
    Change-Id: I1894eb67d49a9ae40cdce29de865172400a271dd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143134
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/external/freetype/ubsan.patch b/external/freetype/ubsan.patch
index 4a743f3ef3f6..6a7688139ae8 100644
--- a/external/freetype/ubsan.patch
+++ b/external/freetype/ubsan.patch
@@ -5,7 +5,7 @@
      table->elements[idx] = FT_OFFSET( table->block, table->cursor );
      table->lengths [idx] = length;
 -    FT_MEM_COPY( table->block + table->cursor, object, length );
-+    if (table->block + table->cursor)
++    if (length != 0)
 +      FT_MEM_COPY( table->block + table->cursor, object, length );
  
      table->cursor += length;
commit 6ced843b73674067a3965b572e6b7e417a054a71
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Fri Nov 25 11:27:57 2022 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Mar 8 20:52:13 2023 +0100

    freetype: don't build yet another copy of zlib
    
    Since commit e515267602d9049bc15739a215f43f1379141d81 the zlib that's
    statically linked into freetype conflicts with the zlib that's
    statically linked into Qt5 because both appear to rename the symbols via
    Z_PREFIX to the same names and thus the linker complains about duplicate
    symbols.
    
    Apparently --without-zlib doesn't disable the feature but instead causes
    freetype to use its own copy; just use --with-zlib instead and rely on
    the ZLIB_CFLAGS/ZLIB_LIBS to find LO's bundled zlib.
    
    Change-Id: I0b5684ca6556c3da7874c17ff2da97b2753b0262
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143289
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/external/freetype/ExternalProject_freetype.mk 
b/external/freetype/ExternalProject_freetype.mk
index a3e0a7ca3e4b..d8d896c5e0e0 100644
--- a/external/freetype/ExternalProject_freetype.mk
+++ b/external/freetype/ExternalProject_freetype.mk
@@ -19,7 +19,7 @@ $(call gb_ExternalProject_get_state_target,freetype,build) :
                $(gb_RUN_CONFIGURE) ./configure \
                        --disable-shared \
                        --with-pic \
-                       --without-zlib \
+                       --with-zlib \
                        --without-brotli \
                        --without-bzip2 \
                        --without-harfbuzz \

Reply via email to