diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-02-21 05:48:37 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-02-21 05:48:37 +0000 |
commit | b5ded3c4f0f1912e575f95c34d97b38809d03443 (patch) | |
tree | eba7484b723d0b687936988fbe112a0983a7ccdf /IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c | |
parent | 6de4c35f99f05f1d956538852c1cf003883043fd (diff) | |
download | edk2-platforms-b5ded3c4f0f1912e575f95c34d97b38809d03443.tar.xz |
BMP file may has padding data between the bmp header section and the bmp data section, but current code logic not consider this case, so the check is not valid for some bmp file. Refine the logic for this case.
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14142 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c')
-rw-r--r-- | IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c index fe6d436a56..02ad3a2bb7 100644 --- a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c +++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c @@ -1,7 +1,7 @@ /** @file
BDS Lib functions which contain all the code to connect console device
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -808,7 +808,10 @@ ConvertBmpToGopBlt ( ColorMapNum = 0;
break;
}
- if (BmpHeader->ImageOffset - sizeof (BMP_IMAGE_HEADER) != sizeof (BMP_COLOR_MAP) * ColorMapNum) {
+ //
+ // BMP file may has padding data between the bmp header section and the bmp data section.
+ //
+ if (BmpHeader->ImageOffset - sizeof (BMP_IMAGE_HEADER) < sizeof (BMP_COLOR_MAP) * ColorMapNum) {
return EFI_INVALID_PARAMETER;
}
}
|