aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common/block_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/liblzma/common/block_util.c')
-rw-r--r--src/liblzma/common/block_util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/liblzma/common/block_util.c b/src/liblzma/common/block_util.c
index 2fa45841..1dccacf4 100644
--- a/src/liblzma/common/block_util.c
+++ b/src/liblzma/common/block_util.c
@@ -58,7 +58,8 @@ lzma_block_unpadded_size(const lzma_block *block)
// NOTE: This function is used for validation too, so it is
// essential that these checks are always done even if
// Compressed Size is unknown.
- if (block->header_size < LZMA_BLOCK_HEADER_SIZE_MIN
+ if (block->version != 0
+ || block->header_size < LZMA_BLOCK_HEADER_SIZE_MIN
|| block->header_size > LZMA_BLOCK_HEADER_SIZE_MAX
|| (block->header_size & 3)
|| !lzma_vli_is_valid(block->compressed_size)