Revision: 14142
          http://edk2.svn.sourceforge.net/edk2/?rev=14142&view=rev
Author:   ydong10
Date:     2013-02-21 05:48:37 +0000 (Thu, 21 Feb 2013)
Log Message:
-----------
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 <[email protected]>
Reviewed-by: Liming Gao <[email protected]>

Modified Paths:
--------------
    trunk/edk2/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c

Modified: trunk/edk2/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c
===================================================================
--- trunk/edk2/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c       
2013-02-21 05:00:21 UTC (rev 14141)
+++ trunk/edk2/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c       
2013-02-21 05:48:37 UTC (rev 14142)
@@ -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 @@
         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;
     }
   }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to