diff options
Diffstat (limited to '')
-rw-r--r-- | CPP/7zip/Compress/LzfseDecoder.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/CPP/7zip/Compress/LzfseDecoder.cpp b/CPP/7zip/Compress/LzfseDecoder.cpp index 41c7445..0eb10af 100644 --- a/CPP/7zip/Compress/LzfseDecoder.cpp +++ b/CPP/7zip/Compress/LzfseDecoder.cpp | |||
@@ -89,11 +89,8 @@ HRESULT CDecoder::DecodeUncompressed(UInt32 unpackSize) | |||
89 | 89 | ||
90 | 90 | ||
91 | 91 | ||
92 | HRESULT CDecoder::DecodeLzvn(UInt32 unpackSize) | 92 | HRESULT CDecoder::DecodeLzvn(UInt32 unpackSize, UInt32 packSize) |
93 | { | 93 | { |
94 | UInt32 packSize; | ||
95 | RINOK(GetUInt32(packSize)); | ||
96 | |||
97 | PRF(printf("\nLZVN %7u %7u", unpackSize, packSize)); | 94 | PRF(printf("\nLZVN %7u %7u", unpackSize, packSize)); |
98 | 95 | ||
99 | UInt32 D = 0; | 96 | UInt32 D = 0; |
@@ -854,6 +851,16 @@ STDMETHODIMP CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStr | |||
854 | UInt64 prevOut = 0; | 851 | UInt64 prevOut = 0; |
855 | UInt64 prevIn = 0; | 852 | UInt64 prevIn = 0; |
856 | 853 | ||
854 | if (LzvnMode) | ||
855 | { | ||
856 | const UInt64 unpackSize = *outSize; | ||
857 | const UInt64 packSize = *inSize; | ||
858 | if (unpackSize > (UInt32)(Int32)-1 | ||
859 | || packSize > (UInt32)(Int32)-1) | ||
860 | return S_FALSE; | ||
861 | RINOK(DecodeLzvn((UInt32)unpackSize, (UInt32)packSize)); | ||
862 | } | ||
863 | else | ||
857 | for (;;) | 864 | for (;;) |
858 | { | 865 | { |
859 | const UInt64 pos = m_OutWindowStream.GetProcessedSize(); | 866 | const UInt64 pos = m_OutWindowStream.GetProcessedSize(); |
@@ -889,7 +896,12 @@ STDMETHODIMP CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStr | |||
889 | if (v == kSignature_LZFSE_V1 || v == kSignature_LZFSE_V2) | 896 | if (v == kSignature_LZFSE_V1 || v == kSignature_LZFSE_V2) |
890 | res = DecodeLzfse(cur, (Byte)v); | 897 | res = DecodeLzfse(cur, (Byte)v); |
891 | else if (v == 0x6E) // 'n' | 898 | else if (v == 0x6E) // 'n' |
892 | res = DecodeLzvn(cur); | 899 | { |
900 | UInt32 packSize; | ||
901 | res = GetUInt32(packSize); | ||
902 | if (res == S_OK) | ||
903 | res = DecodeLzvn(cur, packSize); | ||
904 | } | ||
893 | else if (v == 0x2D) // '-' | 905 | else if (v == 0x2D) // '-' |
894 | res = DecodeUncompressed(cur); | 906 | res = DecodeUncompressed(cur); |
895 | else | 907 | else |