pcf: Fix some data types mismatching with their sources.

This commit is contained in:
suzuki toshiya 2009-08-01 00:30:22 +09:00
parent be41d3e718
commit eae89a7f07
2 changed files with 22 additions and 4 deletions

View File

@ -1,3 +1,14 @@
2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
pcf: Fix some data types mismatching with their sources.
* src/pcf/pcfdrivr.c (pcf_cmap_char_index): The type of
`code' is matched to PCF_Encoding->enc.
(pcf_cmap_char_next): The type of `charcode' is matched
to PCF_Encoding->enc. When *acharcode is set by charcode,
an overflow is checked and casted to unsigned 32-bit
integer.
2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
bdf: Improve bdf_property_t.value names for LP64 platforms.

View File

@ -111,7 +111,7 @@ THE SOFTWARE.
while ( min < max )
{
FT_UInt32 code;
FT_ULong code;
mid = ( min + max ) >> 1;
@ -140,7 +140,7 @@ THE SOFTWARE.
PCF_CMap cmap = (PCF_CMap)pcfcmap;
PCF_Encoding encodings = cmap->encodings;
FT_UInt min, max, mid;
FT_UInt32 charcode = *acharcode + 1;
FT_ULong charcode = *acharcode + 1;
FT_UInt result = 0;
@ -149,7 +149,7 @@ THE SOFTWARE.
while ( min < max )
{
FT_UInt32 code;
FT_ULong code;
mid = ( min + max ) >> 1;
@ -175,7 +175,14 @@ THE SOFTWARE.
}
Exit:
*acharcode = charcode;
if ( charcode > 0xFFFFFFFFUL )
{
FT_TRACE1(( "pcf_cmap_char_next: charcode 0x%x > 32bit API" ));
*acharcode = 0;
/* XXX: result should be changed to indicate an overflow error */
}
else
*acharcode = (FT_UInt32)charcode;
return result;
}