From 675cb55a92782b735fe563b5a7026c8326a39ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20K=C3=A4s?= Date: Wed, 13 Jul 2016 18:50:12 +0200 Subject: [PATCH] Lzma2 decoder needs to reset position when wrapping around. Fix for issue #16. --- shared/Compression/Lzma2/Decoder.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shared/Compression/Lzma2/Decoder.cs b/shared/Compression/Lzma2/Decoder.cs index ba89e55..21f1059 100644 --- a/shared/Compression/Lzma2/Decoder.cs +++ b/shared/Compression/Lzma2/Decoder.cs @@ -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)