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

jvporter at wisc.edu jvporter at wisc.edu
Thu Oct 15 16:33:02 CDT 2009


Author: jvporter
Date: 2009-10-15 16:33:02 -0500 (Thu, 15 Oct 2009)
New Revision: 3205

Modified:
   cgm/trunk/itaps/iGeom_CGMA.cc
Log:
* Fix size-checking and array allocation in iGeom_getArrNrmlUV


Modified: cgm/trunk/itaps/iGeom_CGMA.cc
===================================================================
--- cgm/trunk/itaps/iGeom_CGMA.cc	2009-10-14 20:27:42 UTC (rev 3204)
+++ cgm/trunk/itaps/iGeom_CGMA.cc	2009-10-15 21:33:02 UTC (rev 3205)
@@ -4795,7 +4795,7 @@
 {
   int count;
   size_t face_step, param_step, norm_step;
-  if (gface_handles_size == 2*parameters_size) {
+  if (2*gface_handles_size == parameters_size) {
     count = gface_handles_size;
     face_step = param_step = 1;
   }
@@ -4813,6 +4813,9 @@
     ERROR(iBase_INVALID_ENTITY_COUNT, "Mismatched input array sizes.");
   }
   
+    // check or pre-allocate the coordinate arrays
+  CHECK_SIZE( *normals, double, 3*count );
+
   const double *u, *v;
   double *x, *y, *z;
   u = parameters;



More information about the cgma-dev mailing list