mirror of
git://git.sv.nongnu.org/freetype/freetype2.git
synced 2026-01-19 04:52:09 +00:00
[truetype] Update bytecode error handling.
* src/truetype/ttinterp.c (Ins_SHP,SHPIX,ALIGNRP): Return appropriate error in case of stack underflow. (Ins_IP): Ditto and remove redundant check.
This commit is contained in:
@@ -5190,7 +5190,7 @@
|
||||
if ( exc->new_top < loop )
|
||||
{
|
||||
if ( exc->pedantic_hinting )
|
||||
exc->error = FT_THROW( Invalid_Reference );
|
||||
exc->error = FT_THROW( Too_Few_Arguments );
|
||||
goto Fail;
|
||||
}
|
||||
|
||||
@@ -5345,7 +5345,7 @@
|
||||
if ( exc->new_top < loop )
|
||||
{
|
||||
if ( exc->pedantic_hinting )
|
||||
exc->error = FT_THROW( Invalid_Reference );
|
||||
exc->error = FT_THROW( Too_Few_Arguments );
|
||||
goto Fail;
|
||||
}
|
||||
|
||||
@@ -5849,16 +5849,22 @@
|
||||
FT_F26Dot6 distance;
|
||||
|
||||
|
||||
if ( exc->new_top < loop ||
|
||||
BOUNDS( exc->GS.rp0, exc->zp0.n_points ) )
|
||||
if ( exc->new_top < loop )
|
||||
{
|
||||
if ( exc->pedantic_hinting )
|
||||
exc->error = FT_THROW( Too_Few_Arguments );
|
||||
goto Fail;
|
||||
}
|
||||
|
||||
exc->new_top -= loop;
|
||||
|
||||
if ( BOUNDS( exc->GS.rp0, exc->zp0.n_points ) )
|
||||
{
|
||||
if ( exc->pedantic_hinting )
|
||||
exc->error = FT_THROW( Invalid_Reference );
|
||||
goto Fail;
|
||||
}
|
||||
|
||||
exc->new_top -= loop;
|
||||
|
||||
while ( loop-- )
|
||||
{
|
||||
point = (FT_UShort)*(--args);
|
||||
@@ -6036,12 +6042,19 @@
|
||||
if ( exc->new_top < loop )
|
||||
{
|
||||
if ( exc->pedantic_hinting )
|
||||
exc->error = FT_THROW( Invalid_Reference );
|
||||
exc->error = FT_THROW( Too_Few_Arguments );
|
||||
goto Fail;
|
||||
}
|
||||
|
||||
exc->new_top -= loop;
|
||||
|
||||
if ( BOUNDS( exc->GS.rp1, exc->zp0.n_points ) )
|
||||
{
|
||||
if ( exc->pedantic_hinting )
|
||||
exc->error = FT_THROW( Invalid_Reference );
|
||||
goto Fail;
|
||||
}
|
||||
|
||||
/*
|
||||
* We need to deal in a special way with the twilight zone.
|
||||
* Otherwise, by definition, the value of exc->twilight.orus[n] is (0,0),
|
||||
@@ -6051,13 +6064,6 @@
|
||||
exc->GS.gep1 == 0 ||
|
||||
exc->GS.gep2 == 0 );
|
||||
|
||||
if ( BOUNDS( exc->GS.rp1, exc->zp0.n_points ) )
|
||||
{
|
||||
if ( exc->pedantic_hinting )
|
||||
exc->error = FT_THROW( Invalid_Reference );
|
||||
goto Fail;
|
||||
}
|
||||
|
||||
if ( twilight )
|
||||
orus_base = &exc->zp0.org[exc->GS.rp1];
|
||||
else
|
||||
@@ -6069,8 +6075,7 @@
|
||||
/* fonts out there (e.g. [aeu]grave in monotype.ttf) */
|
||||
/* calling IP[] with bad values of rp[12]. */
|
||||
/* Do something sane when this odd thing happens. */
|
||||
if ( BOUNDS( exc->GS.rp1, exc->zp0.n_points ) ||
|
||||
BOUNDS( exc->GS.rp2, exc->zp1.n_points ) )
|
||||
if ( BOUNDS( exc->GS.rp2, exc->zp1.n_points ) )
|
||||
{
|
||||
old_range = 0;
|
||||
cur_range = 0;
|
||||
|
||||
Reference in New Issue
Block a user