Clear correct flags for doc ownership

Resolves: #2104570
This commit is contained in:
Marek Kasik 2022-07-08 14:20:01 +02:00
parent 16b1c26a1c
commit 209614c14c
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From c26872ed59cba3af2f407b5eefc92fcec92aa52b Mon Sep 17 00:00:00 2001
From: Ben Wagner <bungeman@chromium.org>
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

View File

@ -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 <mkasik@redhat.com> - 2.12.1-2
- Clear correct flags for doc ownership
- Resolves: #2104570
* Mon May 2 2022 Marek Kasik <mkasik@redhat.com> - 2.12.1-1
- Update to 2.12.1
- Resolves: #2080714