]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/Ventoy/VentoyProtocol.c
update languages.ini (#829 #834)
[Ventoy.git] / EDK2 / edk2_mod / edk2-edk2-stable201911 / MdeModulePkg / Application / Ventoy / VentoyProtocol.c
index a6e168e05a1e0d873adb8c84226cf67089acf03b..9866a4a45c7357a664e853ca19206fa8343b0b15 100644 (file)
@@ -474,8 +474,12 @@ EFI_STATUS EFIAPI ventoy_block_io_read
         offset = Lba * 2048;
     }
 
         offset = Lba * 2048;
     }
 
-    VirtSec = g_chain->virt_img_size_in_bytes / 2048;    
-    if (Lba + secNum > VirtSec)
+    VirtSec = g_chain->virt_img_size_in_bytes / 2048;
+    if (Lba >= VirtSec)
+    {
+        return EFI_SUCCESS;
+    }
+    else if (Lba + secNum > VirtSec)
     {
         secNum = VirtSec - Lba;
     }
     {
         secNum = VirtSec - Lba;
     }