[Scipy-svn] r2889 - trunk/Lib/ndimage/src

scipy-svn@scip... scipy-svn@scip...
Thu Mar 29 07:07:16 CDT 2007


Author: stefan
Date: 2007-03-29 07:07:01 -0500 (Thu, 29 Mar 2007)
New Revision: 2889

Modified:
   trunk/Lib/ndimage/src/nd_image.c
Log:
Fix memory errors.


Modified: trunk/Lib/ndimage/src/nd_image.c
===================================================================
--- trunk/Lib/ndimage/src/nd_image.c	2007-03-29 10:10:07 UTC (rev 2888)
+++ trunk/Lib/ndimage/src/nd_image.c	2007-03-29 12:07:01 UTC (rev 2889)
@@ -270,8 +270,8 @@
   double *po = NULL;
   NI_PythonCallbackData *cbdata = (NI_PythonCallbackData*)data;
 
-  py_ibuffer = NA_NewArray(iline, PyArray_DOUBLE, 1, (int)ilen);
-  py_obuffer = NA_NewArray(NULL, PyArray_DOUBLE, 1, (int)olen);
+  py_ibuffer = NA_NewArray(iline, PyArray_DOUBLE, 1, &ilen);
+  py_obuffer = NA_NewArray(NULL, PyArray_DOUBLE, 1, &olen);
   if (!py_ibuffer || !py_obuffer)
     goto exit;
   tmp = Py_BuildValue("(OO)", py_ibuffer, py_obuffer);
@@ -348,7 +348,7 @@
   PyObject *rv = NULL, *args = NULL, *tmp = NULL;
   NI_PythonCallbackData *cbdata = (NI_PythonCallbackData*)data;
 
-  py_buffer = NA_NewArray(buffer, PyArray_DOUBLE, 1, filter_size);
+  py_buffer = NA_NewArray(buffer, PyArray_DOUBLE, 1, &filter_size);
   if (!py_buffer)
     goto exit;
   tmp = Py_BuildValue("(O)", py_buffer);
@@ -1095,7 +1095,7 @@
     goto exit;
   }
   for(jj = 0; jj < n_results; jj++) {
-    histograms[jj] = NA_NewArray(NULL, tInt32, 1, nbins);
+    histograms[jj] = NA_NewArray(NULL, tInt32, 1, &nbins);
     if (!histograms[jj]) {
       PyErr_NoMemory();
       goto exit;



More information about the Scipy-svn mailing list