X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Flzms-decompress.c;h=532dfb59c9393f3b486c4c3661e07af283e6c951;hb=9d38cdb02481552e1f3c7f56181623b2b60fe857;hp=1ddc3f19dfdce40e9b0bc8e8833505654fd95595;hpb=500874ebbf2839d2c93db2b4094817c219946f29;p=wimlib diff --git a/src/lzms-decompress.c b/src/lzms-decompress.c index 1ddc3f19..532dfb59 100644 --- a/src/lzms-decompress.c +++ b/src/lzms-decompress.c @@ -664,7 +664,6 @@ static int lzms_copy_lz_match(struct lzms_decompressor *ctx, u32 length, u32 offset) { u8 *out_next; - u8 *matchptr; if (length > ctx->out_end - ctx->out_next) { LZMS_DEBUG("Match overrun!"); @@ -676,11 +675,10 @@ lzms_copy_lz_match(struct lzms_decompressor *ctx, u32 length, u32 offset) } out_next = ctx->out_next; - matchptr = out_next - offset; - while (length--) - *out_next++ = *matchptr++; - ctx->out_next = out_next; + lz_copy(out_next, length, offset, ctx->out_end); + ctx->out_next = out_next + length; + return 0; }