From nobody Mon Apr 29 13:28:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1529912204887457.7427617907606; Mon, 25 Jun 2018 00:36:44 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id EA9472096F32D; Mon, 25 Jun 2018 00:36:42 -0700 (PDT) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 35DB5209603ED for ; Mon, 25 Jun 2018 00:36:42 -0700 (PDT) Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jun 2018 00:36:42 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.4]) by fmsmga008.fm.intel.com with ESMTP; 25 Jun 2018 00:36:41 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,269,1526367600"; d="scan'208";a="50306494" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Mon, 25 Jun 2018 15:36:57 +0800 Message-Id: <20180625073658.212076-2-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.16.1.windows.1 In-Reply-To: <20180625073658.212076-1-ruiyu.ni@intel.com> References: <20180625073658.212076-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH 1/2] MdeModulePkg/BmpSupportLib: Correct debug message X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael D Kinney , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Michael D Kinney Cc: Star Zeng Reviewed-by: Star Zeng --- MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c b/MdeMo= dulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c index 467cd6a58d..2c23e2c61c 100644 --- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c +++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c @@ -288,7 +288,7 @@ TranslateBmpToGopBlt ( DEBUG (( DEBUG_ERROR, "TranslateBmpToGopBlt: invalid BltBuffer needed size... PixelWidth:0= x%x PixelHeight:0x%x\n", - BltBufferSize + BmpHeader->PixelWidth, BmpHeader->PixelHeight )); =20 return RETURN_UNSUPPORTED; @@ -304,7 +304,7 @@ TranslateBmpToGopBlt ( if (EFI_ERROR (Status)) { DEBUG (( DEBUG_ERROR, - "TranslateBmpToGopBlt: invalid BltBuffer needed size... BltBufferSiz= e:0x%lx struct size:0x%x\n", + "TranslateBmpToGopBlt: invalid BltBuffer needed size... PixelWidth x= PixelHeight:0x%x struct size:0x%x\n", Temp, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) )); =20 --=20 2.16.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Mon Apr 29 13:28:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1529912207501746.5440017114506; Mon, 25 Jun 2018 00:36:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 280BC2096FAC3; Mon, 25 Jun 2018 00:36:44 -0700 (PDT) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2200C2096FAB9 for ; Mon, 25 Jun 2018 00:36:43 -0700 (PDT) Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jun 2018 00:36:42 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.4]) by fmsmga008.fm.intel.com with ESMTP; 25 Jun 2018 00:36:42 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,269,1526367600"; d="scan'208";a="50306497" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Mon, 25 Jun 2018 15:36:58 +0800 Message-Id: <20180625073658.212076-3-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.16.1.windows.1 In-Reply-To: <20180625073658.212076-1-ruiyu.ni@intel.com> References: <20180625073658.212076-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH 2/2] MdeModulePkg/BmpSupportLib: Check PixelHeight/PixelWidth against 0 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael D Kinney , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The patch adds check logic to make sure that for a input BMP file, the width or height is not 0; for a input GOP blt buffer, the width or height is not 0. Otherwise, UNSUPPORTED status is returned. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Star Zeng Cc: Michael D Kinney --- MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c b/MdeMo= dulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c index 2c23e2c61c..6196262d14 100644 --- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c +++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c @@ -148,6 +148,11 @@ TranslateBmpToGopBlt ( return RETURN_UNSUPPORTED; } =20 + if ((BmpHeader->PixelHeight =3D=3D 0) || (BmpHeader->PixelWidth =3D=3D 0= )) { + DEBUG ((DEBUG_ERROR, "TranslateBmpToGopBlt: BmpHeader->PixelHeight or = BmpHeader->PixelWidth is 0.\n")); + return RETURN_UNSUPPORTED; + } + // // Only support BITMAPINFOHEADER format. // BITMAPFILEHEADER + BITMAPINFOHEADER =3D BMP_IMAGE_HEADER @@ -484,6 +489,10 @@ TranslateGopBltToBmp ( return RETURN_INVALID_PARAMETER; } =20 + if ((PixelHeight =3D=3D 0) || (PixelWidth =3D=3D 0)) { + return RETURN_UNSUPPORTED; + } + // // Allocate memory for BMP file. // --=20 2.16.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel