mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Fix overflow on SecureDigital CSD v2.0 size calculation.
This commit is contained in:
@@ -359,7 +359,7 @@ namespace DiscImageChef.Decoders.SecureDigital
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
sb.AppendFormat("\tDevice has {0} blocks", (csd.Size + 1) * 1024).AppendLine();
|
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)
|
if(result > 1099511627776)
|
||||||
sb.AppendFormat("\tDevice has {0} TiB", result / 1099511627776.0).AppendLine();
|
sb.AppendFormat("\tDevice has {0} TiB", result / 1099511627776.0).AppendLine();
|
||||||
else if(result > 1073741824)
|
else if(result > 1073741824)
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ namespace DiscImageChef.Decoders.SecureDigital
|
|||||||
{
|
{
|
||||||
case 0x02: return "Kingston";
|
case 0x02: return "Kingston";
|
||||||
case 0x03: return "Sandisk";
|
case 0x03: return "Sandisk";
|
||||||
|
case 0x27: return "CnMemory";
|
||||||
case 0xAA: return "QEMU";
|
case 0xAA: return "QEMU";
|
||||||
default: return $"Unknown manufacturer ID 0x{sdVendorId:X2}";
|
default: return $"Unknown manufacturer ID 0x{sdVendorId:X2}";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user