1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

In command line tool, take advantage of memusage calculation's

ability to also validate the filter chain and options (not
implemented yet for all filters).
This commit is contained in:
Lasse Collin 2008-12-01 23:04:12 +02:00
parent ccd57afa09
commit ef7890d564

View file

@ -119,9 +119,9 @@ coder_set_compression_settings(void)
message_fatal(_("With --format=lzma only the LZMA1 filter " message_fatal(_("With --format=lzma only the LZMA1 filter "
"is supported")); "is supported"));
// TODO: liblzma probably needs an API to validate the filter chain. // If using --format=raw, we can be decoding. The memusage function
// also validates the filter chain and the options used for the
// If using --format=raw, we can be decoding. // filters.
uint64_t memory_usage; uint64_t memory_usage;
uint64_t memory_limit; uint64_t memory_limit;
if (opt_mode == MODE_COMPRESS) { if (opt_mode == MODE_COMPRESS) {
@ -133,7 +133,7 @@ coder_set_compression_settings(void)
} }
if (memory_usage == UINT64_MAX) if (memory_usage == UINT64_MAX)
message_bug(); message_fatal("Unsupported filter chain or filter options");
if (preset_default) { if (preset_default) {
// When no preset was explicitly requested, we use the default // When no preset was explicitly requested, we use the default