summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/h5tools.c')
-rw-r--r--tools/lib/h5tools.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index a1d0696..4955f95 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -944,8 +944,12 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset
sm_nbytes = p_type_nbytes = H5Tget_size(p_type);
if (ctx.ndims > 0)
- for (i = ctx.ndims; i > 0; --i) {
- sm_size[i - 1] = MIN(total_size[i - 1], H5TOOLS_BUFSIZE / sm_nbytes);
+ for (i = ctx.ndims; i > 0; --i)
+ {
+ hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes;
+ if ( size == 0) /* datum size > H5TOOLS_BUFSIZE */
+ size = 1;
+ sm_size[i - 1] = MIN(total_size[i - 1], size);
sm_nbytes *= sm_size[i - 1];
assert(sm_nbytes > 0);
}