From 5d62196ddee77e44f2e5f590f22c43952f6ab25a Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Wed, 23 Oct 2024 17:01:55 +0200 Subject: [PATCH] Restore stream position in ArchiveFactory.IsArchive --- src/SharpCompress/Archives/ArchiveFactory.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SharpCompress/Archives/ArchiveFactory.cs b/src/SharpCompress/Archives/ArchiveFactory.cs index 02c10699..b81e2c0e 100644 --- a/src/SharpCompress/Archives/ArchiveFactory.cs +++ b/src/SharpCompress/Archives/ArchiveFactory.cs @@ -189,9 +189,10 @@ public static bool IsArchive(Stream stream, out ArchiveType? type) foreach (var factory in Factory.Factories) { + var isArchive = factory.IsArchive(stream); stream.Position = startPosition; - if (factory.IsArchive(stream, null)) + if (isArchive) { type = factory.KnownArchiveType; return true;