]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BMP file may has padding data between the bmp header section and the bmp data section...
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 21 Feb 2013 05:48:37 +0000 (05:48 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 21 Feb 2013 05:48:37 +0000 (05:48 +0000)
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

IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c

index fe6d436a561530ae3bce967e3c7da385e625fdf1..02ad3a2bb78c2588cfa4f893e2d557d9d6d8e8b0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   BDS Lib functions which contain all the code to connect console device\r
 \r
 /** @file\r
   BDS Lib functions which contain all the code to connect console device\r
 \r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -808,7 +808,10 @@ ConvertBmpToGopBlt (
         ColorMapNum = 0;\r
         break;\r
       }\r
         ColorMapNum = 0;\r
         break;\r
       }\r
-    if (BmpHeader->ImageOffset - sizeof (BMP_IMAGE_HEADER) != sizeof (BMP_COLOR_MAP) * ColorMapNum) {\r
+    //\r
+    // BMP file may has padding data between the bmp header section and the bmp data section.\r
+    //\r
+    if (BmpHeader->ImageOffset - sizeof (BMP_IMAGE_HEADER) < sizeof (BMP_COLOR_MAP) * ColorMapNum) {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
   }\r
       return EFI_INVALID_PARAMETER;\r
     }\r
   }\r