summaryrefslogtreecommitdiffstats
path: root/src/H5Zszip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Zszip.c')
-rw-r--r--src/H5Zszip.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/H5Zszip.c b/src/H5Zszip.c
index 71abb54..37c5316 100644
--- a/src/H5Zszip.c
+++ b/src/H5Zszip.c
@@ -143,7 +143,8 @@ H5Z_can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id)
scanline=dims[ndims-1];
/* Adjust scanline if it is smaller than number of pixels per block or
- if it is bigger than maximum pixels per scanline */
+ if it is bigger than maximum pixels per scanline, or there are more than
+ SZ_MAX_BLOCKS_PER_SCANLINE blocks per scanline */
/* Check the pixels per block against the 'scanline' size */
if(scanline<cd_values[H5Z_SZIP_PARM_PPB]) {
@@ -158,10 +159,9 @@ H5Z_can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id)
HGOTO_DONE(TRUE);
}
-
- /* Check the scanline's size against the maximum value and adjust 'scanline'
- size if necessary */
- if(scanline > SZ_MAX_PIXELS_PER_SCANLINE)
+ if(scanline <= SZ_MAX_PIXELS_PER_SCANLINE)
+ scanline = MIN((cd_values[H5Z_SZIP_PARM_PPB] * SZ_MAX_BLOCKS_PER_SCANLINE), scanline);
+ else
scanline = cd_values[H5Z_SZIP_PARM_PPB] * SZ_MAX_BLOCKS_PER_SCANLINE;
done: