block_util.c | block_util.c | |||
---|---|---|---|---|
skipping to change at line 52 | skipping to change at line 52 | |||
extern LZMA_API(lzma_vli) | extern LZMA_API(lzma_vli) | |||
lzma_block_unpadded_size(const lzma_block *block) | lzma_block_unpadded_size(const lzma_block *block) | |||
{ | { | |||
// Validate the values that we are interested in i.e. all but | // Validate the values that we are interested in i.e. all but | |||
// Uncompressed Size and the filters. | // Uncompressed Size and the filters. | |||
// | // | |||
// NOTE: This function is used for validation too, so it is | // NOTE: This function is used for validation too, so it is | |||
// essential that these checks are always done even if | // essential that these checks are always done even if | |||
// Compressed Size is unknown. | // Compressed Size is unknown. | |||
if (block == NULL || block->version != 0 | if (block == NULL || block->version > 1 | |||
|| block->header_size < LZMA_BLOCK_HEADER_SIZE_MIN | || block->header_size < LZMA_BLOCK_HEADER_SIZE_MIN | |||
|| block->header_size > LZMA_BLOCK_HEADER_SIZE_MAX | || block->header_size > LZMA_BLOCK_HEADER_SIZE_MAX | |||
|| (block->header_size & 3) | || (block->header_size & 3) | |||
|| !lzma_vli_is_valid(block->compressed_size) | || !lzma_vli_is_valid(block->compressed_size) | |||
|| block->compressed_size == 0 | || block->compressed_size == 0 | |||
|| (unsigned int)(block->check) > LZMA_CHECK_ID_MAX) | || (unsigned int)(block->check) > LZMA_CHECK_ID_MAX) | |||
return 0; | return 0; | |||
// If Compressed Size is unknown, return that we cannot know | // If Compressed Size is unknown, return that we cannot know | |||
// size of the Block either. | // size of the Block either. | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |