// the 32-bit numerical values is stored in Both-byte orders\r
//\r
if (VolDescriptor->Type == CDVOL_TYPE_CODED) {\r
- VolSpaceSize = VolDescriptor->VolSpaceSize[1];\r
+ VolSpaceSize = VolDescriptor->VolSpaceSize[0];\r
}\r
//\r
// Is it an El Torito volume descriptor?\r
BootEntry++;\r
CdDev.PartitionStart = Catalog->Boot.Lba;\r
if (SectorCount < 2) {\r
- CdDev.PartitionSize = VolSpaceSize;\r
+ //\r
+ // When the SectorCount < 2, set the Partition as the whole CD.\r
+ //\r
+ if (VolSpaceSize > (Media->LastBlock + 1)) {\r
+ CdDev.PartitionSize = (UINT32)(Media->LastBlock - Catalog->Boot.Lba + 1);\r
+ } else {\r
+ CdDev.PartitionSize = (UINT32)(VolSpaceSize - Catalog->Boot.Lba);\r
+ }\r
} else {\r
CdDev.PartitionSize = DivU64x32 (\r
MultU64x32 (\r