adamhathcock / sharpcompress

SharpCompress is a fully managed C# library to deal with many compression types and formats.
MIT License
2.27k stars 481 forks source link

Opening 7zip archive with invalid win32 date #227

Closed Thritton closed 7 years ago

Thritton commented 7 years ago

Hello, Sharpcompress library is very good, thank you for it.

I have a problem with opening 7z achives where one of file has invalid modified date (e.g. 27.2.27586) (These archives are generated automatically from other system I cannot access). When such file is in 7zip archive, ArgumentOutOfRangeException is thrown during getting entries. and file cannot be processed further:

using (var archive = ArchiveFactory.Open(f))
{ 
var files = archive.Entries.Select(x => x.Key).ToList();
}

An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
Additional information: Not a valid Win32 FileTime.

Zip archives with such file work ok (date is ignored). Is it possible to ignore invalid dates in 7z archive as well?

Thank you

adamhathcock commented 7 years ago

I would accept a pull request for this.

adamhathcock commented 7 years ago

Fixed by https://github.com/adamhathcock/sharpcompress/pull/303