Skip to content

Commit 7b9f9ea

Browse files
jdavidmartaiborra
authored andcommitted
Initialize codec and filter params
Fixes segfault with a plugin that uses these params, such as blosc2_openhtj2k
1 parent 833003d commit 7b9f9ea

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

blosc2/blosc2_ext.pyx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ cdef extern from "blosc2.h":
230230
int tuner_id
231231
void* tuner_params
232232
c_bool instr_codec
233+
void* codec_params
234+
void* filter_params[BLOSC2_MAX_FILTERS]
233235

234236
cdef const blosc2_cparams BLOSC2_CPARAMS_DEFAULTS
235237

@@ -713,9 +715,13 @@ cdef create_cparams_from_kwargs(blosc2_cparams *cparams, kwargs):
713715

714716
cparams.prefilter = NULL
715717
cparams.preparams = NULL
716-
cparams.tuner_params = NULL
717718
cparams.tuner_id = 0
719+
cparams.tuner_params = NULL
718720
cparams.instr_codec = False
721+
cparams.codec_params = NULL
722+
for i in range(len(filters)):
723+
cparams.filter_params[i] = NULL
724+
719725
_check_cparams(cparams)
720726

721727

0 commit comments

Comments
 (0)