Skip to content

Commit 4805f87

Browse files
committed
fix: Use only standard built-in compression classes
1 parent 20e879b commit 4805f87

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Source/Orts.Parsers.Msts/Orts.Parsers.Msts.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@
1919
<PrivateAssets>all</PrivateAssets>
2020
</PackageReference>
2121
<PackageReference Include="MonoGame.Framework.WindowsDX" Version="3.8.0.1641" />
22-
<PackageReference Include="SharpZipLib" Version="1.4.1" />
2322
</ItemGroup>
2423
</Project>

Source/Orts.Parsers.Msts/SBR.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
// You should have received a copy of the GNU General Public License
1616
// along with Open Rails. If not, see <http://www.gnu.org/licenses/>.
1717

18-
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
1918
using Microsoft.Xna.Framework;
2019
using System;
2120
using System.Collections.Generic;
2221
using System.Diagnostics;
2322
using System.IO;
23+
using System.IO.Compression;
2424
using System.Text;
2525

2626
namespace Orts.Parsers.Msts
@@ -60,7 +60,9 @@ public static SBR Open(string filename)
6060
// SIMISA@@ means uncompressed
6161
if (headerString.StartsWith("SIMISA@F"))
6262
{
63-
fb = new InflaterInputStream(fb);
63+
// Skip over the 2 byte zlib header and onto the DEFLATE stream itself
64+
fb.Read(buffer, 16, 2);
65+
fb = new DeflateStream(fb, CompressionMode.Decompress);
6466
}
6567
else if (headerString.StartsWith("\r\nSIMISA"))
6668
{

0 commit comments

Comments
 (0)