From b6c7e8f031239f07fce64f6031f08a950b3dcb90 Mon Sep 17 00:00:00 2001 From: Marek Kasik Date: Oct 23 2020 11:10:17 +0000 Subject: 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 --- diff --git a/.gitignore b/.gitignore index f7a0a5a..8bd6c86 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/freetype-2.10.4-png-memory-leak.patch b/freetype-2.10.4-png-memory-leak.patch new file mode 100644 index 0000000..52df99a --- /dev/null +++ b/freetype-2.10.4-png-memory-leak.patch @@ -0,0 +1,43 @@ +From 007c109b4594c5e63948bd08b4d5011ad76ffb10 Mon Sep 17 00:00:00 2001 +From: Ben Wagner +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 ++ ++ * 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 + + * 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 + diff --git a/freetype-2.3.0-enable-spr.patch b/freetype-2.3.0-enable-spr.patch index a234782..2c812cd 100644 --- a/freetype-2.3.0-enable-spr.patch +++ b/freetype-2.3.0-enable-spr.patch @@ -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 diff --git a/freetype.spec b/freetype.spec index 8ceffad..596793c 100644 --- a/freetype.spec +++ b/freetype.spec @@ -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 - 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 - 2.10.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/sources b/sources index 5a56659..a9ea804 100644 --- a/sources +++ b/sources @@ -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