diff options
Diffstat (limited to 'MdePkg/Library/BaseUefiDecompressLib')
-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
|