Resolves:rh#1429574 - [abrt] fontforge: PyFF_OpenFont(): fontforge killed by signal 6

Added patch to fix python module for python3.6
This commit is contained in:
Parag A Nemade 2017-03-09 22:23:58 +05:30
parent c804f4be9d
commit 737ec2b2a2
No known key found for this signature in database
GPG Key ID: 71932951EB71E972
2 changed files with 128 additions and 1 deletions

View File

@ -0,0 +1,121 @@
diff -urN fontforge-20161012.old/fontforge/python.c fontforge-20161012/fontforge/python.c
--- fontforge-20161012.old/fontforge/python.c 2016-10-11 06:59:29.000000000 +0530
+++ fontforge-20161012/fontforge/python.c 2017-03-09 20:16:23.539059197 +0530
@@ -1010,7 +1010,7 @@
if ( !PyArg_ParseTuple(args,"es|i", "UTF-8", &filename, &openflags ))
return( NULL );
locfilename = utf82def_copy(filename);
- free(filename);
+ PyMem_Free(filename);
/* The actual filename opened may be different from the one passed
* to LoadSplineFont, so we can't report the filename on an
@@ -1037,7 +1037,7 @@
if ( !PyArg_ParseTuple(args,"es","UTF-8",&filename) )
return( NULL );
locfilename = utf82def_copy(filename);
- free(filename);
+ PyMem_Free(filename);
ret = GetFontNames(locfilename, 1);
free(locfilename);
cnt = 0;
@@ -4093,7 +4093,7 @@
if ( !PyArg_ParseTuple(args,"es","UTF-8",&filename) )
return( NULL );
locfilename = utf82def_copy(filename);
- free(filename);
+ PyMem_Free(filename);
pt = strrchr(locfilename,'.');
if ( pt==NULL ) pt=locfilename;
@@ -7750,7 +7750,7 @@
if ( !PyArg_ParseTuple(args,"es|O","UTF-8",&filename, &flags) )
return( NULL );
locfilename = utf82def_copy(filename);
- free(filename);
+ PyMem_Free(filename);
/* Check if the file exists and is readable */
if ( access(locfilename,R_OK)!=0 ) {
@@ -7819,7 +7819,7 @@
if ( !PyArg_ParseTuple(args,"es|OO","UTF-8",&filename,&foo,&bar) )
return( NULL );
locfilename = utf82def_copy(filename);
- free(filename);
+ PyMem_Free(filename);
pt = strrchr(locfilename,'.');
if ( pt==NULL ) pt=locfilename;
@@ -13514,7 +13514,7 @@
&to_background) )
return( NULL );
locfilename = utf82def_copy(filename);
- free(filename);
+ PyMem_Free(filename);
ext = strrchr(locfilename,'.');
if ( ext==NULL ) {
@@ -13588,7 +13588,7 @@
if ( !PyArg_ParseTuple(args,"OesO", &other, "UTF-8", &filename, &flagstuple ))
return( NULL );
locfilename = utf82def_copy(filename);
- free(filename);
+ PyMem_Free(filename);
if ( !PyType_IsSubtype(&PyFF_FontType, Py_TYPE(other)) ) {
PyErr_Format(PyExc_TypeError,"First argument must be a fontforge font");
@@ -15655,7 +15655,7 @@
}
}
locfilename = utf82def_copy(filename);
- free(filename);
+ PyMem_Free(filename);
if ( !GenerateScript(fv->sf,locfilename,bitmaptype,iflags,resolution,subfontdirectory,
NULL,fv->normal==NULL?fv->map:fv->normal,rename_to,layer) ) {
PyErr_Format(PyExc_EnvironmentError, "Font generation failed");
@@ -15811,7 +15811,7 @@
}
locfilename = utf82def_copy(filename);
- free(filename);
+ PyMem_Free(filename);
if ( !WriteTTC(locfilename,head,ff_ttc,bf,iflags,layer,ittcflags)) {
PyErr_Format(PyExc_EnvironmentError, "Font generation failed");
@@ -15839,7 +15839,7 @@
if ( !PyArg_ParseTuple(args,"es|s","UTF-8",&filename,&lookup_name) )
return( NULL );
locfilename = utf82def_copy(filename);
- free(filename);
+ PyMem_Free(filename);
if ( lookup_name!=NULL ) {
otl = SFFindLookup(fv->sf,lookup_name);
@@ -15879,7 +15879,8 @@
if ( !PyArg_ParseTuple(args,"es","UTF-8",&filename) )
return( NULL );
locfilename = utf82def_copy(filename);
- free(filename);
+ PyMem_Free(filename);
+
if ( !LoadKerningDataFromMetricsFile(fv->sf,locfilename,fv->map)) {
PyErr_Format(PyExc_EnvironmentError, "No metrics data found");
return( NULL );
@@ -15903,7 +15904,7 @@
&preserveCrossFontKerning, &openflags) )
return( NULL );
locfilename = utf82def_copy(filename);
- free(filename);
+ PyMem_Free(filename);
sf = LoadSplineFont(locfilename,openflags);
if ( sf==NULL ) {
PyErr_Format(PyExc_EnvironmentError, "No font found in file \"%s\"", locfilename);
@@ -15931,7 +15932,7 @@
if ( !PyArg_ParseTuple(args,"des|i",&fraction,"UTF-8",&filename, &openflags) )
return( NULL );
locfilename = utf82def_copy(filename);
- free(filename);
+ PyMem_Free(filename);
sf = LoadSplineFont(locfilename,openflags);
if ( sf==NULL ) {
PyErr_Format(PyExc_EnvironmentError, "No font found in file \"%s\"", locfilename);

View File

@ -4,7 +4,7 @@
Name: fontforge
Version: %{gittag0}
Release: 5%{?dist}
Release: 6%{?dist}
Summary: Outline and bitmap font editor
License: GPLv3+
@ -16,6 +16,8 @@ Source1: http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=snapshot;h=%{
Patch0: fontforge-20140813-use-system-uthash.patch
# Fedora specific patch to have python3 support only
Patch1: Add-python3-support.patch
# https://github.com/fontforge/fontforge/issues/3042
Patch2: fontforge-20161012-fix-free-call-to-PyMem_Free.patch
Requires: xdg-utils
Requires: autotrace
@ -169,6 +171,10 @@ fi
%doc htdocs
%changelog
* Thu Mar 09 2017 Parag Nemade <pnemade AT redhat DOT com> - 20161012-6
- Resolves:rh#1429574 - [abrt] fontforge: PyFF_OpenFont(): fontforge killed by signal 6
- Added patch to fix python module for python3.6
* Sat Feb 18 2017 Parag Nemade <pnemade AT redhat DOT com> - 20161012-5
- Add missing BR: git