X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Flzx-compress.c;h=b23c2df088642ce2d9001ebeba130d8fbba504d8;hp=07fc94724bd0fd73489b3973d6c6a54f0db7b960;hb=2a94ebd67e2a341208c4849a92442ecd511fb716;hpb=01111a94dc42d56da64c4af86c1c379afaabdea0 diff --git a/src/lzx-compress.c b/src/lzx-compress.c index 07fc9472..b23c2df0 100644 --- a/src/lzx-compress.c +++ b/src/lzx-compress.c @@ -747,21 +747,23 @@ wimlib_lzx_compress(const void *__uncompressed_data, unsigned uncompressed_len, #ifdef ENABLE_VERIFY_COMPRESSION /* Verify that we really get the same thing back when decompressing. */ - u8 buf[uncompressed_len]; - ret = wimlib_lzx_decompress(compressed_data, compressed_len, - buf, uncompressed_len); - if (ret != 0) { - ERROR("lzx_compress(): Failed to decompress data we compressed"); - abort(); - } - - for (i = 0; i < uncompressed_len; i++) { - if (buf[i] != *((u8*)__uncompressed_data + i)) { - ERROR("lzx_compress(): Data we compressed didn't " - "decompress to the original data (difference at " - "byte %u of %u)", i + 1, uncompressed_len); + { + u8 buf[uncompressed_len]; + ret = wimlib_lzx_decompress(compressed_data, compressed_len, + buf, uncompressed_len); + if (ret != 0) { + ERROR("lzx_compress(): Failed to decompress data we compressed"); abort(); } + + for (i = 0; i < uncompressed_len; i++) { + if (buf[i] != *((u8*)__uncompressed_data + i)) { + ERROR("lzx_compress(): Data we compressed didn't " + "decompress to the original data (difference at " + "byte %u of %u)", i + 1, uncompressed_len); + abort(); + } + } } #endif return compressed_len;