diff options
Diffstat (limited to 'src/H5FDmpio.c')
-rw-r--r-- | src/H5FDmpio.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 5e2668b..7141550 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -3025,9 +3025,9 @@ H5FD__mpio_read_selection(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED d * s_bufs[] to find the smallest value, and choose that for * mpi_bufs_base. */ - j = 0; /* guess at the index of the smallest value of s_bufs[] */ - if (s_bufs[j + 1].vp != NULL) { + j = 0; /* guess at the index of the smallest value of s_bufs[] */ + if ((count > 1) && (s_bufs[1].vp != NULL)) { for (i = 1; i < count; i++) if (s_bufs[i].vp < s_bufs[j].vp) j = i; @@ -3375,9 +3375,9 @@ H5FD__mpio_write_selection(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED * s_bufs[] to find the smallest value, and choose that for * mpi_bufs_base. */ - j = 0; /* guess at the index of the smallest value of s_bufs[] */ - if (s_bufs[j + 1].cvp != NULL) { + j = 0; /* guess at the index of the smallest value of s_bufs[] */ + if ((count > 1) && (s_bufs[1].cvp != NULL)) { for (i = 1; i < count; i++) if (s_bufs[i].cvp < s_bufs[j].cvp) j = i; |