summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/pfr/pfrsbit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/pfr/pfrsbit.c')
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrsbit.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/3rdparty/freetype/src/pfr/pfrsbit.c b/src/3rdparty/freetype/src/pfr/pfrsbit.c
index d2f17dc9ce..979bf78a26 100644
--- a/src/3rdparty/freetype/src/pfr/pfrsbit.c
+++ b/src/3rdparty/freetype/src/pfr/pfrsbit.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR bitmap loader (body). */
/* */
-/* Copyright 2002, 2003, 2006, 2009 by */
+/* Copyright 2002, 2003, 2006, 2009, 2010, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -59,7 +59,7 @@
if ( !decreasing )
{
- writer->line += writer->pitch * ( target->rows-1 );
+ writer->line += writer->pitch * ( target->rows - 1 );
writer->pitch = -writer->pitch;
}
}
@@ -353,7 +353,7 @@
FT_Long *aadvance,
FT_UInt *aformat )
{
- FT_Error error = 0;
+ FT_Error error = FT_Err_Ok;
FT_Byte flags;
FT_Char b;
FT_Byte* p = *pdata;
@@ -471,7 +471,7 @@
return error;
Too_Short:
- error = PFR_Err_Invalid_Table;
+ error = FT_THROW( Invalid_Table );
FT_ERROR(( "pfr_load_bitmap_metrics: invalid glyph data\n" ));
goto Exit;
}
@@ -484,7 +484,7 @@
FT_Bool decreasing,
FT_Bitmap* target )
{
- FT_Error error = 0;
+ FT_Error error = FT_Err_Ok;
PFR_BitWriterRec writer;
@@ -508,7 +508,7 @@
default:
FT_ERROR(( "pfr_read_bitmap_data: invalid image type\n" ));
- error = PFR_Err_Invalid_File_Format;
+ error = FT_THROW( Invalid_File_Format );
}
}
@@ -560,7 +560,7 @@
}
/* couldn't find it */
- return PFR_Err_Invalid_Argument;
+ return FT_THROW( Invalid_Argument );
}
Found_Strike:
@@ -593,7 +593,7 @@
if ( gps_size == 0 )
{
/* Could not find a bitmap program string for this glyph */
- error = PFR_Err_Invalid_Argument;
+ error = FT_THROW( Invalid_Argument );
goto Exit;
}
}
@@ -636,12 +636,14 @@
* which causes a size truncation, because truncated
* size properties makes bitmap glyph broken.
*/
- if ( xpos > FT_INT_MAX || ( ypos + ysize ) > FT_INT_MAX )
+ if ( xpos > FT_INT_MAX || xpos < FT_INT_MIN ||
+ ysize > FT_INT_MAX || ypos + ysize > FT_INT_MAX ||
+ ypos + (FT_Long)ysize < FT_INT_MIN )
{
FT_TRACE1(( "pfr_slot_load_bitmap:" ));
FT_TRACE1(( "huge bitmap glyph %dx%d over FT_GlyphSlot\n",
xpos, ypos ));
- error = PFR_Err_Invalid_Pixel_Size;
+ error = FT_THROW( Invalid_Pixel_Size );
}
if ( !error )