[CHDFile] Ensure CHD is not blocking DFD

This commit is contained in:
Matt Nadareski
2018-02-21 10:54:43 -08:00
parent 4c6884d2a5
commit 61fb788800

View File

@@ -173,14 +173,21 @@ namespace SabreTools.Library.FileTypes
_headerVersion = ValidateHeaderVersion(); _headerVersion = ValidateHeaderVersion();
byte[] hash = GetHashFromHeader(); if (_headerVersion != null)
if (hash.Length == Constants.MD5Length)
{ {
_md5 = hash; byte[] hash = GetHashFromHeader();
}
else if (hash.Length == Constants.SHA1Length) if (hash != null)
{ {
_sha1 = hash; if (hash.Length == Constants.MD5Length)
{
_md5 = hash;
}
else if (hash.Length == Constants.SHA1Length)
{
_sha1 = hash;
}
}
} }
} }