summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseUefiDecompressLib
diff options
context:
space:
mode:
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2008-08-01 23:21:07 +0000
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2008-08-01 23:21:07 +0000
commit7fd58cbc7e0eb861255ffd691d4ffacbaff94e89 (patch)
tree3e9a7546125f7e5b6225813108ed767220c26cc8 /MdePkg/Library/BaseUefiDecompressLib
parent520c9369195c2f56aadeb34f45b87d37f82c9eb4 (diff)
downloadedk2-platforms-7fd58cbc7e0eb861255ffd691d4ffacbaff94e89.tar.xz
Use ReadUnaligned32() instead of CopyMem()
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5604 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BaseUefiDecompressLib')
-rw-r--r--MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c10
-rw-r--r--MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf1
2 files changed, 6 insertions, 5 deletions
diff --git a/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c b/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c
index feba9fdd6d..ea9f5071ea 100644
--- a/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c
+++ b/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c
@@ -16,6 +16,7 @@
#include <Base.h>
+#include <Library/BaseLib.h>
#include <Library/UefiDecompressLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
@@ -689,19 +690,18 @@ UefiDecompressGetInfo (
ASSERT (DestinationSize != NULL);
ASSERT (ScratchSize != NULL);
- *ScratchSize = sizeof (SCRATCH_DATA);
-
if (SourceSize < 8) {
return RETURN_INVALID_PARAMETER;
}
- CopyMem (&CompressedSize, Source, sizeof (UINT32));
- CopyMem (DestinationSize, (VOID *)((UINT8 *)Source + 4), sizeof (UINT32));
-
+ CompressedSize = ReadUnaligned32 ((UINT32 *)Source);
if (SourceSize < (CompressedSize + 8)) {
return RETURN_INVALID_PARAMETER;
}
+ *ScratchSize = sizeof (SCRATCH_DATA);
+ *DestinationSize = ReadUnaligned32 ((UINT32 *)Source + 1);
+
return RETURN_SUCCESS;
}
diff --git a/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf b/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
index f017d24454..3e7305095b 100644
--- a/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
+++ b/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
@@ -39,6 +39,7 @@
[LibraryClasses]
+ BaseLib
BaseMemoryLib
DebugLib