# HG changeset patch # User mas01mc # Date 1290652253 0 # Node ID 98d2e1de11bba2e4c14219e54bbdedd7787183de # Parent d93292ae7c1ba86a0771cb6ed456b7aaedabac0f Fixed array boundary error on 1d array retrieval diff -r d93292ae7c1b -r 98d2e1de11bb bindings/python/pyadbmodule.c --- a/bindings/python/pyadbmodule.c Wed Nov 24 19:29:52 2010 +0000 +++ b/bindings/python/pyadbmodule.c Thu Nov 25 02:30:53 2010 +0000 @@ -1011,7 +1011,7 @@ if(features){ if(ins->dim>1){ dims=2; - shape[1]= ins->dim; + shape[1]= ins->dim; } else{ dims=1; @@ -1042,7 +1042,10 @@ /* Copy the data, this allows us to free the allocated memory and let * python do the subsequent garbage collection itself. */ - int num_items = ins->nvectors * ins->dim; + int num_items = ins->nvectors; + if(dims>1){ + num_items *= shape[1]; + } double* p = (double*) PyArray_DATA(outgoing); double* d = data; while(num_items--)