forked from minhngoc25a/freetype2
[gf] Minor Fixes.
This commit is contained in:
parent
7635ca9624
commit
ed698a3b3b
@ -238,14 +238,14 @@
|
||||
|
||||
{
|
||||
FT_Bitmap_Size* bsize = gfface->available_sizes;
|
||||
FT_UShort x_res, y_res;
|
||||
/* FT_UShort x_res, y_res; */
|
||||
|
||||
bsize->height = (FT_Short) face->gf_glyph->font_bbx_h ;
|
||||
bsize->width = (FT_Short) face->gf_glyph->font_bbx_w ;
|
||||
bsize->size = (FT_Pos) face->gf_glyph->ds << 6 ;
|
||||
|
||||
x_res = toint( go->hppp * 72.27 );
|
||||
y_res = toint( go->vppp * 72.27 );
|
||||
/* x_res = toint( go->hppp * 72.27 ); */
|
||||
/* y_res = toint( go->vppp * 72.27 ); */
|
||||
|
||||
bsize->y_ppem = (FT_Pos)(bsize->size/10) << 6 ;
|
||||
bsize->x_ppem = (FT_Pos)bsize->y_ppem ;
|
||||
|
@ -404,11 +404,17 @@ unsigned char bit_table[] = {
|
||||
min_n = READ_INT4( stream );
|
||||
max_n = READ_INT4( stream );
|
||||
|
||||
if( ptr_p < 0 )
|
||||
if( ptr_p < 0 ) /* Defined to use ptr_p */
|
||||
{
|
||||
FT_ERROR(( "gf_load_font: invalid pointer in postamble\n" ));
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
if( check_sum < 0 ) /* Defined to use check_sum */
|
||||
{
|
||||
FT_ERROR(( "gf_load_font: invalid check sum value\n" ));
|
||||
goto Exit;
|
||||
}
|
||||
#if 0
|
||||
gptr = ftell(fp);
|
||||
#endif
|
||||
@ -504,6 +510,11 @@ unsigned char bit_table[] = {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
if( w > max_m)
|
||||
{
|
||||
FT_ERROR(( "gf_load_font: invalid width in charloc\n" ));
|
||||
goto Exit;
|
||||
}
|
||||
/* optr = ft_ftell(fp); */
|
||||
optr = stream->pos;
|
||||
/* ft_fseek(fp, ptr, SEEK_SET); */
|
||||
@ -521,11 +532,16 @@ unsigned char bit_table[] = {
|
||||
goto Exit;
|
||||
}
|
||||
*goptr = go;
|
||||
return error;
|
||||
return error;
|
||||
|
||||
Exit:
|
||||
Exit:
|
||||
if (go != NULL)
|
||||
{
|
||||
if( go->bm_table )
|
||||
{
|
||||
for (i = 0; i < nchars; i++)
|
||||
FT_FREE(go->bm_table[i].bitmap);
|
||||
}
|
||||
FT_FREE(go->bm_table);
|
||||
FT_FREE(go);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user