Skip to content

Commit

Permalink
Merge pull request #876 from Morilli/fix-isarchive-stream-seek
Browse files Browse the repository at this point in the history
Restore stream position in ArchiveFactory.IsArchive
  • Loading branch information
adamhathcock authored Oct 24, 2024
2 parents 7fe27ac + 5d62196 commit 6aeef8d
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 6aeef8d

Please sign in to comment.