Limitation on numbers of entities to pass the SUEntitiesFill method

Is there some limitation on the number of entities I can pass to the SUEntitiesFill method?
I’ve wrote a C application to convert an obj file from my I pad 3D scanner app to a skp file.
The application works very fine but on the biggest models I get an SU_ERROR_INVALID_INPUT error with the SUEntitiesFill method.

Number of faces I try to add when getting the errror is 1.228.660, a model with 871.128 faces works without a problem.