[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();
byte[] hash = GetHashFromHeader();
if (hash.Length == Constants.MD5Length)
if (_headerVersion != null)
{
_md5 = hash;
}
else if (hash.Length == Constants.SHA1Length)
{
_sha1 = hash;
byte[] hash = GetHashFromHeader();
if (hash != null)
{
if (hash.Length == Constants.MD5Length)
{
_md5 = hash;
}
else if (hash.Length == Constants.SHA1Length)
{
_sha1 = hash;
}
}
}
}