From b5ded3c4f0f1912e575f95c34d97b38809d03443 Mon Sep 17 00:00:00 2001 From: ydong10 Date: Thu, 21 Feb 2013 05:48:37 +0000 Subject: [PATCH] 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 Reviewed-by: Liming Gao git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14142 6f19259b-4bc3-4df7-8a09-765794883524 --- IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c | 7 +++++-- 1 file 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.
+Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.
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; } } -- 2.39.2