]> granicus.if.org Git - xz/commitdiff
Fix lzma_block_compressed_size().
authorLasse Collin <lasse.collin@tukaani.org>
Thu, 27 May 2010 13:17:42 +0000 (16:17 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Thu, 27 May 2010 13:17:42 +0000 (16:17 +0300)
src/liblzma/common/block_util.c

index cb9cde255e657bec3528c4d9b90c444083ac3e56..62c934547c9e5a0962182176e0dc05c11074c627 100644 (file)
@@ -15,7 +15,7 @@
 
 
 extern LZMA_API(lzma_ret)
-lzma_block_compressed_size(lzma_block *block, lzma_vli total_size)
+lzma_block_compressed_size(lzma_block *block, lzma_vli unpadded_size)
 {
        // Validate everything but Uncompressed Size and filters.
        if (lzma_block_unpadded_size(block) == 0)
@@ -25,13 +25,13 @@ lzma_block_compressed_size(lzma_block *block, lzma_vli total_size)
                        + lzma_check_size(block->check);
 
        // Validate that Compressed Size will be greater than zero.
-       if (container_size <= total_size)
+       if (unpadded_size <= container_size)
                return LZMA_DATA_ERROR;
 
        // Calculate what Compressed Size is supposed to be.
        // If Compressed Size was present in Block Header,
        // compare that the new value matches it.
-       const lzma_vli compressed_size = total_size - container_size;
+       const lzma_vli compressed_size = unpadded_size - container_size;
        if (block->compressed_size != LZMA_VLI_UNKNOWN
                        && block->compressed_size != compressed_size)
                return LZMA_DATA_ERROR;