From 24005ac2e2fa9bc59cd0b89f67c9aced138a3759 Mon Sep 17 00:00:00 2001 From: Marta Iborra Date: Thu, 18 Apr 2024 10:23:38 +0200 Subject: [PATCH] Keep track of current nchunk when seting a slice (needed when applying prefilters) --- blosc/b2nd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/blosc/b2nd.c b/blosc/b2nd.c index e5047baf..44a50069 100644 --- a/blosc/b2nd.c +++ b/blosc/b2nd.c @@ -784,6 +784,8 @@ int get_set_slice(void *buffer, int64_t buffersize, const int64_t *start, const uint8_t *chunk = malloc(chunk_nbytes); BLOSC_ERROR_NULL(chunk, BLOSC2_ERROR_MEMORY_ALLOC); int brc; + // Update current_chunk in case a prefilter is applied + array->sc->current_nchunk = nchunk; brc = blosc2_compress_ctx(array->sc->cctx, data, data_nbytes, chunk, chunk_nbytes); if (brc < 0) { BLOSC_TRACE_ERROR("Blosc can not compress the data");