aboutsummaryrefslogtreecommitdiff
path: root/src/xz/coder.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2010-09-02 19:22:35 +0300
committerLasse Collin <lasse.collin@tukaani.org>2010-09-02 19:22:35 +0300
commita848e47ced6e5e2a564b5c454b2f5a19c2f40298 (patch)
tree4add82e2d1bd88943e9079876fa7e8a90ff19859 /src/xz/coder.c
parentxz: Always warn if adjusting dictionary size due to memlimit. (diff)
downloadxz-a848e47ced6e5e2a564b5c454b2f5a19c2f40298.tar.xz
xz: Make setting a preset override a custom filter chain.
This is more logical behavior than ignoring preset level options once a custom filter chain has been specified.
Diffstat (limited to '')
-rw-r--r--src/xz/coder.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xz/coder.c b/src/xz/coder.c
index af49f430..841f63a4 100644
--- a/src/xz/coder.c
+++ b/src/xz/coder.c
@@ -67,6 +67,15 @@ extern void
coder_set_preset(size_t new_preset)
{
preset_number = new_preset;
+
+ // Setting a preset makes us forget a possibly defined custom
+ // filter chain.
+ while (filters_count > 0) {
+ --filters_count;
+ free(filters[filters_count].options);
+ filters[filters_count].options = NULL;
+ }
+
return;
}