diff options
author | mdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-08-01 23:21:07 +0000 |
---|---|---|
committer | mdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-08-01 23:21:07 +0000 |
commit | 7fd58cbc7e0eb861255ffd691d4ffacbaff94e89 (patch) | |
tree | 3e9a7546125f7e5b6225813108ed767220c26cc8 /MdePkg | |
parent | 520c9369195c2f56aadeb34f45b87d37f82c9eb4 (diff) | |
download | edk2-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')
-rw-r--r-- | MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c | 10 | ||||
-rw-r--r-- | MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf | 1 |
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
|