diff --git a/src/SharpCompress/Compressors/Rar/UnpackV2017/Unpack.unpack50_cpp.cs b/src/SharpCompress/Compressors/Rar/UnpackV2017/Unpack.unpack50_cpp.cs index b362dae0..4cf75009 100644 --- a/src/SharpCompress/Compressors/Rar/UnpackV2017/Unpack.unpack50_cpp.cs +++ b/src/SharpCompress/Compressors/Rar/UnpackV2017/Unpack.unpack50_cpp.cs @@ -637,7 +637,7 @@ bool ReadTables(BitInput Inp,ref UnpackBlockHeader Header, ref UnpackBlockTables BitLength[I]=(byte)Length; } - MakeDecodeTables(BitLength,Tables.BD,BC); + MakeDecodeTables(BitLength,0,Tables.BD,BC); byte[] Table = new byte[HUFF_TABLE_SIZE]; const uint TableSize=HUFF_TABLE_SIZE; @@ -702,10 +702,10 @@ bool ReadTables(BitInput Inp,ref UnpackBlockHeader Header, ref UnpackBlockTables TablesRead5=true; if (!Inp.ExternalBuffer && Inp.InAddr>ReadTop) return false; - MakeDecodeTables(&Table[0],Tables.LD,NC); - MakeDecodeTables(&Table[NC],Tables.DD,DC); - MakeDecodeTables(&Table[NC+DC],Tables.LDD,LDC); - MakeDecodeTables(&Table[NC+DC+LDC],Tables.RD,RC); + MakeDecodeTables(Table, 0, Tables.LD,NC); + MakeDecodeTables(Table, (int)NC,Tables.DD,DC); + MakeDecodeTables(Table, (int)(NC+DC),Tables.LDD,LDC); + MakeDecodeTables(Table, (int)(NC+DC+LDC),Tables.RD,RC); return true; } diff --git a/src/SharpCompress/Compressors/Rar/UnpackV2017/Unpack.unpack_cpp.cs b/src/SharpCompress/Compressors/Rar/UnpackV2017/Unpack.unpack_cpp.cs index 352da170..619974c2 100644 --- a/src/SharpCompress/Compressors/Rar/UnpackV2017/Unpack.unpack_cpp.cs +++ b/src/SharpCompress/Compressors/Rar/UnpackV2017/Unpack.unpack_cpp.cs @@ -233,7 +233,7 @@ void UnpInitData(bool Solid) // LengthTable contains the length in bits for every element of alphabet. // Dec is the structure to decode Huffman code/ // Size is size of length table and DecodeNum field in Dec structure, -void MakeDecodeTables(byte[] LengthTable,DecodeTable Dec,uint Size) +void MakeDecodeTables(byte[] LengthTable, int offset, DecodeTable Dec,uint Size) { // Size of alphabet and DecodePos array. Dec.MaxNum=Size; @@ -242,7 +242,7 @@ void MakeDecodeTables(byte[] LengthTable,DecodeTable Dec,uint Size) uint[] LengthCount = new uint[16]; //memset(LengthCount,0,sizeof(LengthCount)); for (size_t I=0;I