/* This check should avoid most internal overflow cases. Clients should generally respond to  */
static FT_Error cf2_checkTransform(const CF2_Matrix *transform, CF2_Int unitsPerEm)
/* This check should avoid most internal overflow cases. Clients should generally respond to  */
static FT_Error cf2_checkTransform(const CF2_Matrix *transform, CF2_Int unitsPerEm)
{
    CF2_Fixed  maxScale;
    FT_ASSERT( unitsPerEm > 0 );
    if ( transform->a <= 0 || transform->d <= 0 )
      return FT_THROW( Invalid_Size_Handle );
    FT_ASSERT( transform->b == 0 && transform->c == 0 );
    FT_ASSERT( transform->tx == 0 && transform->ty == 0 );
    if ( unitsPerEm > 0x7FFF )
      return FT_THROW( Glyph_Too_Big );
    maxScale = FT_DivFix( CF2_MAX_SIZE, cf2_intToFixed( unitsPerEm ) );
    if ( transform->a > maxScale || transform->d > maxScale )
      return FT_THROW( Glyph_Too_Big );
    return FT_Err_Ok;
  }