Fix previous commit, over zealous cleaning of code
@@ -2134,7 +2134,7 @@ internal_exr_compute_chunk_offset_size (struct _internal_exr_part* curpart)
}
else
{
- uint64_t linePerChunk;
+ uint64_t linePerChunk, h;
switch (curpart->comp_type)
{
case EXR_COMPRESSION_NONE:
@@ -2176,7 +2176,8 @@ internal_exr_compute_chunk_offset_size (struct _internal_exr_part* curpart)
curpart->lines_per_chunk = ((int16_t) linePerChunk);
curpart->chan_has_line_sampling = ((int16_t) hasLineSample);
- retval = (int32_t) ((w + linePerChunk - 1) / linePerChunk);
+ h = (uint64_t) dw.max.y - (uint64_t) dw.min.y + 1;
+ retval = (int32_t) ((h + linePerChunk - 1) / linePerChunk);
}
return retval;
}
