diff --git a/freetype-2.12.1-clear-ownership-flags.patch b/freetype-2.12.1-clear-ownership-flags.patch new file mode 100644 index 0000000..2598188 --- /dev/null +++ b/freetype-2.12.1-clear-ownership-flags.patch @@ -0,0 +1,29 @@ +From c26872ed59cba3af2f407b5eefc92fcec92aa52b Mon Sep 17 00:00:00 2001 +From: Ben Wagner +Date: Thu, 26 May 2022 20:27:53 -0400 +Subject: [svg] Clear correct flags for doc ownership + +This issue was discovered with an SVG based font with some documents +compressed and other uncompressed. After loading the first compressed +document the ownership flag on the glyph slot was set to true but never +set to false. As a result after loading a compressed document a glyph +from an uncompressed document would load fine, but when this glyph slot +was cleared it would try to free its document resulting in a wild free. + +* src/base/ftobjs.c (ft_glyphslot_clear): clear correct flags + +Fixes: #1162 + +diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c +index eeda69c3e..f66273f3d 100644 +--- a/src/base/ftobjs.c ++++ b/src/base/ftobjs.c +@@ -605,7 +605,7 @@ + + + FT_FREE( doc->svg_document ); +- slot->internal->load_flags &= ~FT_GLYPH_OWN_GZIP_SVG; ++ slot->internal->flags &= ~FT_GLYPH_OWN_GZIP_SVG; + } + } + #endif diff --git a/freetype.spec b/freetype.spec index 563b053..4c6bb76 100644 --- a/freetype.spec +++ b/freetype.spec @@ -4,7 +4,7 @@ Summary: A free and portable font rendering engine Name: freetype Version: 2.12.1 -Release: 1%{?dist} +Release: 2%{?dist} License: (FTL or GPLv2+) and BSD and MIT and Public Domain and zlib with acknowledgement URL: http://www.freetype.org Source: http://download.savannah.gnu.org/releases/freetype/freetype-%{version}.tar.xz @@ -27,6 +27,8 @@ Patch5: freetype-2.10.0-internal-outline.patch # Revert ABI/API change Patch6: freetype-2.10.1-debughook.patch +Patch7: freetype-2.12.1-clear-ownership-flags.patch + BuildRequires: gcc BuildRequires: libX11-devel BuildRequires: libpng-devel @@ -89,6 +91,7 @@ popd %patch4 -p1 -b .multilib %patch5 -p1 -b .internal-outline %patch6 -p1 -b .debughook +%patch7 -p1 -b .clear-ownership-flags %build @@ -230,6 +233,10 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.{a,la} %{_mandir}/man1/* %changelog +* Fri Jul 8 2022 Marek Kasik - 2.12.1-2 +- Clear correct flags for doc ownership +- Resolves: #2104570 + * Mon May 2 2022 Marek Kasik - 2.12.1-1 - Update to 2.12.1 - Resolves: #2080714