I recently ran into an issue with the matio-1.5.21 library, trying to read a double complex Matlab array of size 32x1x1024
Here is a dump of some fields of the matvar
dims[0]=32
dims[1]=1
dims[2]=1024
nbytes= 262144
data_size= 8
isComplex= 2048
Assuming the array is of double complex type, shouldn't data_size be 16 for one element, i.e. 2 * sizeof(double) ?
The nbytes therefore is undersized by a factor of 2 and a memcpy operation into an appropriately sized buffer (in my case an Eigen::Tensor from the Eigen matrix library intended to store that data) causes a segfault.
Hi,
I recently ran into an issue with the matio-1.5.21 library, trying to read a double complex Matlab array of size 32x1x1024
Here is a dump of some fields of the matvar dims[0]=32 dims[1]=1 dims[2]=1024 nbytes= 262144 data_size= 8 isComplex= 2048
Assuming the array is of double complex type, shouldn't data_size be 16 for one element, i.e. 2 * sizeof(double) ?
The nbytes therefore is undersized by a factor of 2 and a memcpy operation into an appropriately sized buffer (in my case an Eigen::Tensor from the Eigen matrix library intended to store that data) causes a segfault.
Christian