mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-02-16 13:55:18 +00:00
CanSeek can throw exceptions
This commit is contained in:
@@ -165,14 +165,14 @@ namespace BinaryObjectScanner.FileType
|
||||
else if (!File.Exists(file))
|
||||
return protections;
|
||||
|
||||
// If the stream isn't seekable
|
||||
if (!stream.CanSeek)
|
||||
return protections;
|
||||
|
||||
// Read the file contents
|
||||
byte[] fileContent = [];
|
||||
try
|
||||
{
|
||||
// If the stream isn't seekable
|
||||
if (!stream.CanSeek)
|
||||
return protections;
|
||||
|
||||
stream.Seek(0, SeekOrigin.Begin);
|
||||
fileContent = stream.ReadBytes((int)stream.Length);
|
||||
if (fileContent == null)
|
||||
|
||||
Reference in New Issue
Block a user