X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FDisk%2FUdfDxe%2FFileSystemOperations.c;fp=MdeModulePkg%2FUniversal%2FDisk%2FUdfDxe%2FFileSystemOperations.c;h=cabb599695aaa684476263e108d2a2315e83ab48;hp=f1205bbb8eed2b890367beabbe563ece04a71292;hb=85acb5e8ffef026b80241b1657ed4fba26e382b1;hpb=32698a8f013140b8f77f18a03c64c40ba04c2e18 diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index f1205bbb8e..cabb599695 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -242,11 +242,16 @@ GetPdFromLongAd ( // // NOTE: Only one Type 1 (Physical) Partition is supported. It has been // checked already in Partition driver for existence of a single Type 1 - // Partition map, so we don't have to double check here. + // Partition map. Hence, the 'PartitionReferenceNumber' field (the index + // used to access Partition Maps data within the Logical Volume Descriptor) + // in the Long Allocation Descriptor should be 0 to indicate there is only + // one partition. // - // Partition reference number can also be retrieved from - // LongAd->ExtentLocation.PartitionReferenceNumber, however the spec says - // it may be 0, so let's not rely on it. + if (LongAd->ExtentLocation.PartitionReferenceNumber != 0) { + return NULL; + } + // + // Since only one partition, get the first one directly. // PartitionNum = *(UINT16 *)((UINTN)&LogicalVolDesc->PartitionMaps[4]); break;