From 418d64a32e8144210f98a810738fed5a897e8367 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Sat, 14 Nov 2009 18:59:19 +0200 Subject: Fix a design error in liblzma API. Originally the idea was that using LZMA_FULL_FLUSH with Stream encoder would read the filter chain from the same array that was used to intialize the Stream encoder. Since most apps wouldn't use LZMA_FULL_FLUSH, most apps wouldn't need to keep the filter chain available after initializing the Stream encoder. However, due to my mistake, it actually required keeping the array always available. Since setting the new filter chain via the array used at initialization time is not a nice way to do it for a couple of reasons, this commit ditches it and introduces lzma_filters_update(). This new function replaces also the "persistent" flag used by LZMA2 (and to-be-designed Subblock filter), which was also an ugly thing to do. Thanks to Alexey Tourbin for reminding me about the problem that Stream encoder used to require keeping the filter chain allocated. --- src/liblzma/delta/delta_decoder.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/liblzma/delta/delta_decoder.c') diff --git a/src/liblzma/delta/delta_decoder.c b/src/liblzma/delta/delta_decoder.c index 2ddf163d..2cf60d5b 100644 --- a/src/liblzma/delta/delta_decoder.c +++ b/src/liblzma/delta/delta_decoder.c @@ -50,7 +50,8 @@ extern lzma_ret lzma_delta_decoder_init(lzma_next_coder *next, lzma_allocator *allocator, const lzma_filter_info *filters) { - return lzma_delta_coder_init(next, allocator, filters, &delta_decode); + next->code = &delta_decode; + return lzma_delta_coder_init(next, allocator, filters); } -- cgit v1.2.3