diff options
author | jhendersonHDF <jhenderson@hdfgroup.org> | 2022-02-04 16:53:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-04 16:53:55 (GMT) |
commit | 36d9a165e428eb883f9fd72b6707555536292845 (patch) | |
tree | 61848a7a985725dcbb52daab3a986ff490cf909c /src/H5Zscaleoffset.c | |
parent | 856de93673f2bd097b90e2803475ef4fc3d689fa (diff) | |
download | hdf5-36d9a165e428eb883f9fd72b6707555536292845.zip hdf5-36d9a165e428eb883f9fd72b6707555536292845.tar.gz hdf5-36d9a165e428eb883f9fd72b6707555536292845.tar.bz2 |
Fix a few issues noted by LGTM (#1421)
Diffstat (limited to 'src/H5Zscaleoffset.c')
-rw-r--r-- | src/H5Zscaleoffset.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 5bdc51c..46c1a10 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -1240,7 +1240,7 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu p.minbits = minbits; /* calculate size of output buffer after decompression */ - size_out = d_nelmts * p.size; + size_out = d_nelmts * (size_t)p.size; /* allocate memory space for decompressed buffer */ if (NULL == (outbuf = (unsigned char *)H5MM_malloc(size_out))) @@ -1403,7 +1403,7 @@ H5Z__scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size) unsigned char *buffer, temp; buffer = (unsigned char *)buf; - for (i = 0; i < d_nelmts * dtype_size; i += dtype_size) + for (i = 0; i < d_nelmts * (size_t)dtype_size; i += dtype_size) for (j = 0; j < dtype_size / 2; j++) { /* swap pair of bytes */ temp = buffer[i + j]; @@ -1681,7 +1681,7 @@ H5Z__scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned cha unsigned buf_len; /* must initialize to zeros */ - for (i = 0; i < d_nelmts * p.size; i++) + for (i = 0; i < d_nelmts * (size_t)p.size; i++) data[i] = 0; /* initialization before the loop */ |