uefi: Fix off by one when loading footers.
am: e9fbb111d7
Change-Id: Idad9447c1e99317e54c1f2a68046c944dbe7c337
diff --git a/examples/uefi/uefi_avb_ops.c b/examples/uefi/uefi_avb_ops.c
index 3f22d03..e849b71 100644
--- a/examples/uefi/uefi_avb_ops.c
+++ b/examples/uefi/uefi_avb_ops.c
@@ -194,8 +194,9 @@
return AVB_IO_RESULT_ERROR_NO_SUCH_PARTITION;
}
- partition_size = (partition_entry->last_lba - partition_entry->first_lba) *
- data->block_io->Media->BlockSize;
+ partition_size =
+ (partition_entry->last_lba - partition_entry->first_lba + 1) *
+ data->block_io->Media->BlockSize;
if (offset_from_partition < 0) {
if ((-offset_from_partition) > partition_size) {