mirror of
https://git.tukaani.org/xz.git
synced 2024-04-04 12:36:23 +02:00
Fix a crash with --format=alone if other filters than LZMA
are specified on the command line.
This commit is contained in:
parent
2f361ac19b
commit
8e074349e4
1 changed files with 9 additions and 0 deletions
|
@ -462,6 +462,15 @@ set_compression_settings(void)
|
||||||
// Terminate the filter options array.
|
// Terminate the filter options array.
|
||||||
opt_filters[filter_count].id = LZMA_VLI_VALUE_UNKNOWN;
|
opt_filters[filter_count].id = LZMA_VLI_VALUE_UNKNOWN;
|
||||||
|
|
||||||
|
// If we are using the LZMA_Alone format, allow exactly one filter
|
||||||
|
// which has to be LZMA.
|
||||||
|
if (opt_header == HEADER_ALONE && (filter_count != 1
|
||||||
|
|| opt_filters[0].id != LZMA_FILTER_LZMA)) {
|
||||||
|
errmsg(V_ERROR, _("With --format=alone only the LZMA filter "
|
||||||
|
"is supported"));
|
||||||
|
my_exit(ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
// Optimize the filter chain a little by removing all
|
// Optimize the filter chain a little by removing all
|
||||||
// Copy filters.
|
// Copy filters.
|
||||||
for (size_t i = 0; opt_filters[i].id != LZMA_VLI_VALUE_UNKNOWN; ++i) {
|
for (size_t i = 0; opt_filters[i].id != LZMA_VLI_VALUE_UNKNOWN; ++i) {
|
||||||
|
|
Loading…
Reference in a new issue