HDFGroup / HDF.PInvoke

Raw HDF5 Power for .NET
http://www.hdfgroup.org/HDF5
Other
80 stars 29 forks source link

H5F.get_file_image() buf_len parameter should not be passed by ref #134

Closed polivbr closed 6 years ago

polivbr commented 6 years ago

The buf_len parameter to H5F.get_file_image() is currently passed by ref, which is causing the address to the variable to be passed to the underlying H5Fget_file_image() function, rather than the value.

A quick scan of the other methods on the H5F class makes me think there are other methods which have this same issue, but I haven't had time to verify.

gheber commented 6 years ago

Great catch! The prototype in H5Fpublic.h is

H5_DLL ssize_t H5Fget_file_image(hid_t file_id, void * buf_ptr, size_t buf_len);

There's a mistake in the documentation https://support.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-GetFileImage

ssize_t H5Fget_file_image( hid_t file_id, void *buf_ptr, size_t *buf_len );

which I must have been following at the time.

gheber commented 6 years ago

https://jira.hdfgroup.org/browse/HDFFV-10455