mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-07-12 03:56:55 +00:00
Merge pull request #118 from kenkendk/master
Bugfix for inflate algorithm cutting of the end of certain blocks
This commit is contained in:
@@ -895,6 +895,11 @@ namespace SharpCompress.Compressor.Deflate
|
||||
r = ZlibConstants.Z_OK;
|
||||
else
|
||||
{
|
||||
// Handling missing trailing bit(s)
|
||||
var tmp_tindex = (tree_index + (b & InternalInflateConstants.InflateMask[k]))*3;
|
||||
if (k >= tree[tmp_tindex + 1])
|
||||
break;
|
||||
|
||||
blocks.bitb = b;
|
||||
blocks.bitk = k;
|
||||
z.AvailableBytesIn = n;
|
||||
@@ -998,6 +1003,11 @@ namespace SharpCompress.Compressor.Deflate
|
||||
r = ZlibConstants.Z_OK;
|
||||
else
|
||||
{
|
||||
// Handling missing trailing bit(s)
|
||||
var tmp_tindex = (tree_index + (b & InternalInflateConstants.InflateMask[k]))*3;
|
||||
if (k >= tree[tmp_tindex + 1])
|
||||
break;
|
||||
|
||||
blocks.bitb = b;
|
||||
blocks.bitk = k;
|
||||
z.AvailableBytesIn = n;
|
||||
|
||||
Reference in New Issue
Block a user