Skip to content

Commit

Permalink
lzma: Provide 10% slack space for uncompressable data
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberShadow committed Jul 19, 2014
1 parent a2d22e7 commit 0486c1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lzma.d
@@ -1,5 +1,5 @@
/*
* Copyright 2012, 2013 Vladimir Panteleev <vladimir@thecybershadow.net>
* Copyright 2012, 2013, 2014 Vladimir Panteleev <vladimir@thecybershadow.net>
* This file is part of RABCDAsm.
*
* RABCDAsm is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -79,7 +79,7 @@ ubyte[] lzmaCompress(in ubyte[] decompressedData, LZMAHeader* header)
lzmaEnforce(lzma_alone_encoder(&strm, &opts), "lzma_alone_encoder");
scope(exit) lzma_end(&strm);

auto outBuf = new ubyte[decompressedData.length + 1024];
auto outBuf = new ubyte[decompressedData.length * 11 / 10 + 1024];
strm.next_out = outBuf.ptr;
strm.avail_out = outBuf.length;
strm.next_in = decompressedData.ptr;
Expand Down

0 comments on commit 0486c1a

Please sign in to comment.