* src/type/t1afm.c (compare_kern_pairs), src/pxaux/afmparse.c

(afm_compare_kern_pairs): Fix comparison.  This fixes Savannah bug
#24119.
This commit is contained in:
Werner Lemberg 2008-08-23 19:54:06 +00:00
parent 4c60bd916c
commit a4cb0d95d9
5 changed files with 47 additions and 17 deletions

View File

@ -1,10 +1,16 @@
2008-08-23 Werner Lemberg <wl@gnu.org>
* src/type/t1afm.c (compare_kern_pairs), src/pxaux/afmparse.c
(afm_compare_kern_pairs): Fix comparison. This fixes Savannah bug
#24119.
2008-08-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
* src/base/ftobjs.c (FT_Stream_New): Initialize *astream
always, even if passed library or arguments are invalid.
This fixes a bug that uninitialized stream is freed when
an invalid library handle is passed. Originally proposed
by Mike Fabian, 2008/08/18 on freetype-devel.
* src/base/ftobjs.c (FT_Stream_New): Initialize *astream always,
even if passed library or arguments are invalid. This fixes a bug
that an uninitialized stream is freed when an invalid library handle
is passed. Originally proposed by Mike Fabian, 2008/08/18 on
freetype-devel.
(FT_Open_Face): Ditto (stream).
(load_face_in_embedded_rfork): Ditto (stream2).

View File

@ -50,11 +50,11 @@
FT_UShort* b )
{
if ( *a < *b )
return ( -1 );
return -1;
else if ( *a > *b )
return ( 1 );
return 1;
else
return ( 0 );
return 0;
}
@ -115,11 +115,11 @@
FT_ULong* b )
{
if ( *a < *b )
return ( -1 );
return -1;
else if ( *a > *b )
return ( 1 );
return 1;
else
return ( 0 );
return 0;
}

View File

@ -4,7 +4,7 @@
/* */
/* AFM parser (body). */
/* */
/* Copyright 2006, 2007 by */
/* Copyright 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -672,7 +672,12 @@
FT_ULong index2 = KERN_INDEX( kp2->index1, kp2->index2 );
return (int)( index1 - index2 );
if ( index1 > index2 )
return 1;
else if ( index1 < index2 )
return -1;
else
return 0;
}

View File

@ -174,9 +174,23 @@
/* sort base glyphs before glyph variants */
if ( unicode1 == unicode2 )
return map1->unicode - map2->unicode;
{
if ( map1->unicode > map2->unicode )
return 1;
else if ( map1->unicode < map2->unicode )
return -1;
else
return 0;
}
else
return unicode1 - unicode2;
{
if ( unicode1 > unicode2 )
return 1;
else if ( unicode1 < unicode2 )
return -1;
else
return 0;
}
}

View File

@ -4,7 +4,7 @@
/* */
/* AFM support for Type 1 fonts (body). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -88,7 +88,12 @@
FT_ULong index2 = KERN_INDEX( pair2->index1, pair2->index2 );
return (int)( index1 - index2 );
if ( index1 > index2 )
return 1;
else if ( index1 < index2 )
return -1;
else
return 0;
}