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

scipy-svn at scipy.org scipy-svn at scipy.org
Wed Jul 12 16:54:21 EDT 2006


Author: cookedm
Date: 2006-07-12 15:54:20 -0500 (Wed, 12 Jul 2006)
New Revision: 2086

Modified:
   trunk/Lib/ndimage/src/nd_image.c
Log:
Fix segfault in ndimage on 64-bit machine.
'i' was being used in PyArg_ParseTuple instead of 'l' for a npy_intp (maybelong)
argument.


Modified: trunk/Lib/ndimage/src/nd_image.c
===================================================================
--- trunk/Lib/ndimage/src/nd_image.c	2006-07-12 20:24:08 UTC (rev 2085)
+++ trunk/Lib/ndimage/src/nd_image.c	2006-07-12 20:54:20 UTC (rev 2086)
@@ -1075,12 +1075,14 @@
   PyObject *indices_object, *result = NULL;
   maybelong min_label, max_label, *result_indices = NULL, n_results;
   maybelong jj, nbins;
+  long nbins_in;
   double min, max;
-  
-  if (!PyArg_ParseTuple(args, "O&ddiO&O", NI_ObjectToInputArray, &input, 
-                        &min, &max, &nbins, NI_ObjectToOptionalInputArray,
+
+  if (!PyArg_ParseTuple(args, "O&ddlO&O", NI_ObjectToInputArray, &input,
+                        &min, &max, &nbins_in, NI_ObjectToOptionalInputArray,
                         &labels, &indices_object))
     goto exit;
+  nbins = nbins_in;
 
   if (!_NI_GetIndices(indices_object, &result_indices, &min_label,
                       &max_label, &n_results))




More information about the Scipy-svn mailing list