Update to 2.10.4

Test bitmap size earlier for PNGs
Fix memory leak in pngshim.c
Enable man pages for demos

Resolves: #1887084, #1890211
This commit is contained in:
Marek Kasik 2020-10-23 13:10:17 +02:00
parent 7ebf3fc38d
commit b6c7e8f031
5 changed files with 88 additions and 8 deletions

3
.gitignore vendored
View File

@ -88,3 +88,6 @@ ft2demos-2.4.2.tar.bz2
/freetype-2.10.2.tar.xz
/freetype-doc-2.10.2.tar.xz
/ft2demos-2.10.2.tar.xz
/freetype-2.10.4.tar.xz
/freetype-doc-2.10.4.tar.xz
/ft2demos-2.10.4.tar.xz

View File

@ -0,0 +1,43 @@
From 007c109b4594c5e63948bd08b4d5011ad76ffb10 Mon Sep 17 00:00:00 2001
From: Ben Wagner <bungeman@google.com>
Date: Fri, 23 Oct 2020 08:29:14 +0200
Subject: [PATCH] * src/sfnt/pngshim.c (Load_SBit_Png): Fix memory leak
(#59322).
The issue is that `rows` is allocated but will not be freed in the
event that the call to `png_read_image` fails and calls `longjmp`.
---
ChangeLog | 7 +++++++
src/sfnt/pngshim.c | 1 +
2 files changed, 8 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 42f7c34ba..ff048b8ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-10-23 Ben Wagner <bungeman@google.com>
+
+ * src/sfnt/pngshim.c (Load_SBit_Png): Fix memory leak (#59322).
+
+ The issue is that `rows` is allocated but will not be freed in the
+ event that the call to `png_read_image` fails and calls `longjmp`.
+
2020-10-20 Werner Lemberg <wl@gnu.org>
* Version 2.10.4 released.
diff --git a/src/sfnt/pngshim.c b/src/sfnt/pngshim.c
index f55016122..d4e43a9f4 100644
--- a/src/sfnt/pngshim.c
+++ b/src/sfnt/pngshim.c
@@ -443,6 +443,7 @@
png_read_end( png, info );
DestroyExit:
+ FT_FREE( rows );
png_destroy_read_struct( &png, &info, NULL );
FT_Stream_Close( &stream );
--
2.26.2

View File

@ -1,8 +1,8 @@
--- freetype-2.3.0/include/freetype/config/ftoption.h.spf 2007-01-18 14:27:34.000000000 -0500
+++ freetype-2.3.0/include/freetype/config/ftoption.h 2007-01-18 14:27:48.000000000 -0500
@@ -92,7 +92,7 @@
* macro is not defined, FreeType offers alternative LCD rendering
* technology that produces excellent output without LCD filtering.
* When this macro is not defined, FreeType offers alternative LCD
* rendering technology that produces excellent output.
*/
-/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING

View File

@ -2,8 +2,8 @@
Summary: A free and portable font rendering engine
Name: freetype
Version: 2.10.2
Release: 3%{?dist}
Version: 2.10.4
Release: 1%{?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
@ -26,6 +26,8 @@ Patch5: freetype-2.10.0-internal-outline.patch
# Revert ABI/API change
Patch6: freetype-2.10.1-debughook.patch
Patch7: freetype-2.10.4-png-memory-leak.patch
BuildRequires: gcc
BuildRequires: libX11-devel
BuildRequires: libpng-devel
@ -84,6 +86,7 @@ popd
%patch4 -p1 -b .multilib
%patch5 -p1 -b .internal-outline
%patch6 -p1 -b .debughook
%patch7 -p1 -b .png-memory-leak
%build
@ -122,7 +125,7 @@ popd
%make_install gnulocaledir=$RPM_BUILD_ROOT%{_datadir}/locale
{
for ftdemo in ftbench ftchkwd ftmemchk ftpatchk fttimer ftdump ftlint ftmemchk ftvalid ; do
for ftdemo in ftbench ftchkwd ftmemchk ftpatchk fttimer ftdump ftlint ftvalid ; do
builds/unix/libtool --mode=install install -m 755 ft2demos-%{version}/bin/$ftdemo $RPM_BUILD_ROOT/%{_bindir}
done
}
@ -134,6 +137,20 @@ popd
}
%endif
# man pages for freetype-demos
{
for ftdemo in ftbench ftdump ftlint ftvalid ; do
builds/unix/libtool --mode=install install -m 644 ft2demos-%{version}/man/${ftdemo}.1 $RPM_BUILD_ROOT/%{_mandir}/man1
done
}
%if %{with_xfree86}
{
for ftdemo in ftdiff ftgamma ftgrid ftmulti ftstring ftview ; do
builds/unix/libtool --mode=install install -m 644 ft2demos-%{version}/man/${ftdemo}.1 $RPM_BUILD_ROOT/%{_mandir}/man1
done
}
%endif
# fix multilib issues
%define wordsize %{__isa_bits}
@ -172,6 +189,10 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.{a,la}
%{_bindir}/ftdump
%{_bindir}/ftlint
%{_bindir}/ftvalid
%{_mandir}/man1/ftbench.1.gz
%{_mandir}/man1/ftdump.1.gz
%{_mandir}/man1/ftlint.1.gz
%{_mandir}/man1/ftvalid.1.gz
%if %{with_xfree86}
%{_bindir}/ftdiff
%{_bindir}/ftgamma
@ -179,6 +200,12 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.{a,la}
%{_bindir}/ftmulti
%{_bindir}/ftstring
%{_bindir}/ftview
%{_mandir}/man1/ftdiff.1.gz
%{_mandir}/man1/ftgamma.1.gz
%{_mandir}/man1/ftgrid.1.gz
%{_mandir}/man1/ftmulti.1.gz
%{_mandir}/man1/ftstring.1.gz
%{_mandir}/man1/ftview.1.gz
%endif
%doc ChangeLog README
@ -197,6 +224,13 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.{a,la}
%{_mandir}/man1/*
%changelog
* Fri Oct 23 2020 Marek Kasik <maksik@redhat.com> - 2.10.4-1
- Update to 2.10.4
- Test bitmap size earlier for PNGs
- Fix memory leak in pngshim.c
- Enable man pages for demos
- Resolves: #1887084, #1890211
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.10.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

View File

@ -1,3 +1,3 @@
SHA512 (freetype-2.10.2.tar.xz) = cf45089bd8893d7de2cdcb59d91bbb300e13dd0f0a9ef80ed697464ba7aeaf46a5a81b82b59638e6b21691754d8f300f23e1f0d11683604541d77f0f581affaa
SHA512 (freetype-doc-2.10.2.tar.xz) = c54956a56920e651102b75c0efa07212e1d95f3bec219b8364b61d9a71171b11da492170cc861c36f3305f32ad1dee46d0d5a561ccdc6ca36591ae3f619a1d67
SHA512 (ft2demos-2.10.2.tar.xz) = 912e3c3cbcdfd30fd918897d28240e04eb7248d130fc519e7d1613873a11d275d658ff247c6d517ebecf7a09de0d05f3dc10631411226015e1b147cba9a8a438
SHA512 (freetype-2.10.4.tar.xz) = 827cda734aa6b537a8bcb247549b72bc1e082a5b32ab8d3cccb7cc26d5f6ee087c19ce34544fa388a1eb4ecaf97600dbabc3e10e950f2ba692617fee7081518f
SHA512 (freetype-doc-2.10.4.tar.xz) = 171da6c6a172869e9bec0da67cb1abdb0fdb124870f13b751b4e9b1b5e342fb2af38cb606db1c3dcf18076a077e694b7b8dd055dd7f4ab49afe7e1d61b4f9ba8
SHA512 (ft2demos-2.10.4.tar.xz) = d2afc19e5fabbee5205fcc992f6c19bab03485b7af4f55bb2d2dd0a4a9492a3f593540862ca116b54cf161b240d7966cb31a9793578d164fc418449e339e2fa8