Fix overflow on SecureDigital CSD v2.0 size calculation.

This commit is contained in:
2018-08-05 01:09:43 +01:00
parent a7e8c43183
commit 3f0429586b
2 changed files with 2 additions and 1 deletions

View File

@@ -359,7 +359,7 @@ namespace DiscImageChef.Decoders.SecureDigital
else
{
sb.AppendFormat("\tDevice has {0} blocks", (csd.Size + 1) * 1024).AppendLine();
result = (csd.Size + 1) * 1024 * 512;
result = ((ulong)csd.Size + 1) * 1024 * 512;
if(result > 1099511627776)
sb.AppendFormat("\tDevice has {0} TiB", result / 1099511627776.0).AppendLine();
else if(result > 1073741824)