Skip to content

Commit

Permalink
Lzma2 decoder needs to reset position when wrapping around. Fix for i…
Browse files Browse the repository at this point in the history
…ssue #16.
  • Loading branch information
weltkante committed Jul 13, 2016
1 parent 98c8008 commit 675cb55
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions shared/Compression/Lzma2/Decoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ public int Decode(byte[] buffer, int offset, int length, int? limit, bool eof)
var mode = eof ? LZMA.Master.LZMA.ELzmaFinishMode.LZMA_FINISH_END : LZMA.Master.LZMA.ELzmaFinishMode.LZMA_FINISH_ANY;

if (mDecoderPosition == mDecoder.mDecoder.mDicBufSize)
{
mDecoder.mDecoder.mDicPos = 0;
mDecoderPosition = 0;
}

long outputLimit = mDecoder.mDecoder.mDicBufSize;
if (limit.HasValue)
Expand Down

0 comments on commit 675cb55

Please sign in to comment.