decompress_unxz: allocate permanent crc32 table _fisrt_
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 1 Jun 2010 21:26:54 +0000 (23:26 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 1 Jun 2010 21:26:54 +0000 (23:26 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
archival/libunarchive/decompress_unxz.c

index 374b76d66529706dbbded003c3a1a805cf5249f4..3f939298415e8dd4f094e1b3f3ede0248d1838b9 100644 (file)
@@ -62,15 +62,15 @@ unpack_xz_stream(int src_fd, int dst_fd)
                OUT_SIZE = 60 * 1024,
        };
 
+       if (!crc32_table)
+               crc32_table = crc32_filltable(NULL, /*endian:*/ 0);
+
        membuf = xmalloc(IN_SIZE + OUT_SIZE);
        memset(&iobuf, 0, sizeof(iobuf));
        iobuf.in = membuf;
        iobuf.out = membuf + IN_SIZE;
        iobuf.out_size = OUT_SIZE;
 
-       if (!crc32_table)
-               crc32_table = crc32_filltable(NULL, /*endian:*/ 0);
-
        state = xz_dec_init(64*1024); /* initial dict of 64k */
 
        while (1) {