Skip to content

Commit 656f8e6

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 0108ae8 + 3ce2a39 commit 656f8e6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎src/blosc2/blosc2_ext.pyx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2739,7 +2739,10 @@ cdef int aux_miniexpr(me_udata *udata, int64_t nchunk, int32_t nblock,
27392739
input_buffers[i] = malloc(block_nbytes)
27402740
if input_buffers[i] == NULL:
27412741
raise MemoryError("miniexpr: cannot allocate input block buffer")
2742-
memset(input_buffers[i], 0, block_nbytes) # zero padding, matches b2nd semantics
2742+
if valid_nitems < blocknitems:
2743+
# Partial blocks need zero-filled padding. Full blocks are
2744+
# overwritten byte-for-byte by the raw NumPy gather below.
2745+
memset(input_buffers[i], 0, block_nbytes)
27432746

27442747
np_ndim = udata.array.ndim
27452748
blosc2_unidim_to_multidim(np_ndim, udata.chunks_in_array, nchunk, chunk_ndim)

0 commit comments

Comments
 (0)