summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c')
-rw-r--r--MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c
index 8de55945ce..6b0beee632 100644
--- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c
+++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c
@@ -47,12 +47,15 @@
VOID *
EFIAPI
ScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
+ IN CONST VOID *Buffer,
+ IN UINTN Length,
+ IN UINT32 Value
)
{
- if (Length == 0) {
+ UINTN Stride;
+
+ Stride = Length / sizeof (Value);
+ if (Stride == 0) {
return NULL;
}
@@ -60,5 +63,5 @@ ScanMem32 (
ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);
+ return (VOID*)InternalMemScanMem32 (Buffer, Stride, Value);
}