aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common/stream_encoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/liblzma/common/stream_encoder.c')
-rw-r--r--src/liblzma/common/stream_encoder.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/liblzma/common/stream_encoder.c b/src/liblzma/common/stream_encoder.c
index 705ec0eb..054e1145 100644
--- a/src/liblzma/common/stream_encoder.c
+++ b/src/liblzma/common/stream_encoder.c
@@ -292,7 +292,8 @@ lzma_stream_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
next->coder->filters[0].id = LZMA_VLI_UNKNOWN;
// Initialize the Index
- next->coder->index = lzma_index_init(next->coder->index, allocator);
+ lzma_index_end(next->coder->index, allocator);
+ next->coder->index = lzma_index_init(allocator);
if (next->coder->index == NULL)
return LZMA_MEM_ERROR;