Skip to content

Commit

Permalink
Restore stream position in ArchiveFactory.IsArchive
Browse files Browse the repository at this point in the history
  • Loading branch information
Morilli committed Oct 23, 2024
1 parent 7fe27ac commit 5d62196
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/SharpCompress/Archives/ArchiveFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5d62196

Please sign in to comment.