]> wimlib.net Git - wimlib/blobdiff - src/lzms-decompress.c
{lzx,lzms-decompress.c}: Allocate context with DECODE_TABLE_ALIGNMENT
[wimlib] / src / lzms-decompress.c
index 6cc6dab326e795484ed678a3716cf06bff77efe0..1ddc3f19dfdce40e9b0bc8e8833505654fd95595 100644 (file)
@@ -304,7 +304,7 @@ struct lzms_huffman_decoder {
        u8 lens[LZMS_MAX_NUM_SYMS];
 
        /* The codeword of each symbol in the Huffman code.  */
-       u16 codewords[LZMS_MAX_NUM_SYMS];
+       u32 codewords[LZMS_MAX_NUM_SYMS];
 
        /* A table for quickly decoding symbols encoded using the Huffman code.
         */
@@ -1032,7 +1032,7 @@ lzms_free_decompressor(void *_ctx)
 {
        struct lzms_decompressor *ctx = _ctx;
 
-       FREE(ctx);
+       ALIGNED_FREE(ctx);
 }
 
 static int
@@ -1042,7 +1042,8 @@ lzms_create_decompressor(size_t max_block_size,
 {
        struct lzms_decompressor *ctx;
 
-       ctx = MALLOC(sizeof(struct lzms_decompressor));
+       ctx = ALIGNED_MALLOC(sizeof(struct lzms_decompressor),
+                            DECODE_TABLE_ALIGNMENT);
        if (ctx == NULL)
                return WIMLIB_ERR_NOMEM;