forked from minhngoc25a/freetype2
Fix Savannah bug #30220.
* include/freetype/fterrdef.h (BDF_Err_Missing_Fontboundingbox_Field): New error code. * src/bdf/bdflib.c (_bdf_parse_start): Check for missing `FONTBOUNDINGBOX' field. Avoid memory leak if there are multiple `FONT' lines (which is invalid but doesn't hurt).
This commit is contained in:
parent
ddc4b136d6
commit
fb69029a7a
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2010-06-23 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
Fix Savannah bug #30220.
|
||||||
|
|
||||||
|
* include/freetype/fterrdef.h
|
||||||
|
(BDF_Err_Missing_Fontboundingbox_Field): New error code.
|
||||||
|
|
||||||
|
* src/bdf/bdflib.c (_bdf_parse_start): Check for missing
|
||||||
|
`FONTBOUNDINGBOX' field.
|
||||||
|
Avoid memory leak if there are multiple `FONT' lines (which is
|
||||||
|
invalid but doesn't hurt).
|
||||||
|
|
||||||
2010-06-21 Werner Lemberg <wl@gnu.org>
|
2010-06-21 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
Fix Savannah bug #30168.
|
Fix Savannah bug #30168.
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
/* */
|
/* */
|
||||||
/* FreeType error codes (specification). */
|
/* FreeType error codes (specification). */
|
||||||
/* */
|
/* */
|
||||||
/* Copyright 2002, 2004, 2006, 2007 by */
|
/* Copyright 2002, 2004, 2006, 2007, 2010 by */
|
||||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of the FreeType project, and may only be used, */
|
/* This file is part of the FreeType project, and may only be used, */
|
||||||
|
@ -220,19 +220,21 @@
|
||||||
"`FONT' field missing" )
|
"`FONT' field missing" )
|
||||||
FT_ERRORDEF_( Missing_Size_Field, 0xB2, \
|
FT_ERRORDEF_( Missing_Size_Field, 0xB2, \
|
||||||
"`SIZE' field missing" )
|
"`SIZE' field missing" )
|
||||||
FT_ERRORDEF_( Missing_Chars_Field, 0xB3, \
|
FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3, \
|
||||||
|
"`FONTBOUNDINGBOX' field missing" )
|
||||||
|
FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \
|
||||||
"`CHARS' field missing" )
|
"`CHARS' field missing" )
|
||||||
FT_ERRORDEF_( Missing_Startchar_Field, 0xB4, \
|
FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \
|
||||||
"`STARTCHAR' field missing" )
|
"`STARTCHAR' field missing" )
|
||||||
FT_ERRORDEF_( Missing_Encoding_Field, 0xB5, \
|
FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \
|
||||||
"`ENCODING' field missing" )
|
"`ENCODING' field missing" )
|
||||||
FT_ERRORDEF_( Missing_Bbx_Field, 0xB6, \
|
FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \
|
||||||
"`BBX' field missing" )
|
"`BBX' field missing" )
|
||||||
FT_ERRORDEF_( Bbx_Too_Big, 0xB7, \
|
FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \
|
||||||
"`BBX' too big" )
|
"`BBX' too big" )
|
||||||
FT_ERRORDEF_( Corrupted_Font_Header, 0xB8, \
|
FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \
|
||||||
"Font header corrupted or missing fields" )
|
"Font header corrupted or missing fields" )
|
||||||
FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xB9, \
|
FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \
|
||||||
"Font glyphs corrupted or missing fields" )
|
"Font glyphs corrupted or missing fields" )
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2082,6 +2082,14 @@
|
||||||
/* Check for the start of the properties. */
|
/* Check for the start of the properties. */
|
||||||
if ( ft_memcmp( line, "STARTPROPERTIES", 15 ) == 0 )
|
if ( ft_memcmp( line, "STARTPROPERTIES", 15 ) == 0 )
|
||||||
{
|
{
|
||||||
|
if ( !(p->flags & _BDF_FONT_BBX ) )
|
||||||
|
{
|
||||||
|
/* Missing the FONTBOUNDINGBOX field. */
|
||||||
|
FT_ERROR(( "_bdf_parse_start: " ERRMSG1, lineno, "FONTBOUNDINGBOX" ));
|
||||||
|
error = BDF_Err_Missing_Fontboundingbox_Field;
|
||||||
|
goto Exit;
|
||||||
|
}
|
||||||
|
|
||||||
error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
|
error = _bdf_list_split( &p->list, (char *)" +", line, linelen );
|
||||||
if ( error )
|
if ( error )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
@ -2144,6 +2152,9 @@
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Allowing multiple `FONT' lines (which is invalid) doesn't hurt... */
|
||||||
|
FT_FREE( p->font->name );
|
||||||
|
|
||||||
if ( FT_NEW_ARRAY( p->font->name, slen + 1 ) )
|
if ( FT_NEW_ARRAY( p->font->name, slen + 1 ) )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
FT_MEM_COPY( p->font->name, s, slen + 1 );
|
FT_MEM_COPY( p->font->name, s, slen + 1 );
|
||||||
|
|
Loading…
Reference in New Issue