From 6503fde658a5cdbdd907a788865470dd64771601 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Sun, 7 Feb 2010 19:48:06 +0200 Subject: Subtle change to liblzma Block handling API. lzma_block.version has to be initialized even for lzma_block_header_decode(). This way a future version of liblzma won't allocate memory in a way that an old application doesn't know how to free it. The subtlety of this change is that all current apps using lzma_block_header_decode() will keep working for now, because the only possible version value is zero, and lzma_block_header_decode() unconditionally sets the version to zero even now. Unless fixed, these apps will break in the future if a new version of the Block options is ever needed. --- src/liblzma/common/stream_decoder.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/liblzma/common/stream_decoder.c') diff --git a/src/liblzma/common/stream_decoder.c b/src/liblzma/common/stream_decoder.c index 60cc8247..37ea71ed 100644 --- a/src/liblzma/common/stream_decoder.c +++ b/src/liblzma/common/stream_decoder.c @@ -182,6 +182,9 @@ stream_decode(lzma_coder *coder, lzma_allocator *allocator, coder->pos = 0; + // Version 0 is currently the only possible version. + coder->block_options.version = 0; + // Set up a buffer to hold the filter chain. Block Header // decoder will initialize all members of this array so // we don't need to do it here. -- cgit v1.2.3