[cgma-dev] r3197 - cgm/trunk/itaps

jvporter at wisc.edu jvporter at wisc.edu
Sun Oct 11 01:04:13 CDT 2009


Author: jvporter
Date: 2009-10-11 01:04:10 -0500 (Sun, 11 Oct 2009)
New Revision: 3197

Modified:
   cgm/trunk/itaps/iGeom_CGMA.cc
Log:
Fix array allocation and dimension-checking issues in 
iGeom_getArrUVtoXYZ


Modified: cgm/trunk/itaps/iGeom_CGMA.cc
===================================================================
--- cgm/trunk/itaps/iGeom_CGMA.cc	2009-10-09 19:38:10 UTC (rev 3196)
+++ cgm/trunk/itaps/iGeom_CGMA.cc	2009-10-11 06:04:10 UTC (rev 3197)
@@ -3891,7 +3891,7 @@
 {
   size_t ent_step, coord_step, uv_step;
   int count;
-  if (gentity_handles_size == 2*uv_size) {
+  if (2*gentity_handles_size == uv_size) {
     ent_step = uv_step = 1;
     count = gentity_handles_size;
   }
@@ -3908,6 +3908,8 @@
   else {
     ERROR(iBase_INVALID_ENTITY_COUNT, "Mismatched input array sizes.");
   }
+
+  CHECK_SIZE( *coordinates, double, 3*count );
     
   const double *u, *v;
   double *x, *y, *z;
@@ -3928,8 +3930,6 @@
     uv_step *= 2;
   }
   
-  CHECK_SIZE( *coordinates, double, 3*count );
-  
   RefEntity** ent = (RefEntity**)gentity_handles;
   for (int i = 0; i < count; ++i) {
     RefFace* face = dynamic_cast<RefFace*>(*ent);



More information about the cgma-dev mailing list