From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 8F8B3210F1566 for ; Mon, 2 Jul 2018 19:16:47 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jul 2018 19:16:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,301,1526367600"; d="scan'208";a="71793420" Received: from ray-dev.ccr.corp.intel.com (HELO [10.239.9.4]) ([10.239.9.4]) by orsmga002.jf.intel.com with ESMTP; 02 Jul 2018 19:16:28 -0700 To: "Zeng, Star" , "edk2-devel@lists.01.org" Cc: "Kinney, Michael D" References: <20180625073658.212076-1-ruiyu.ni@intel.com> <20180625073658.212076-3-ruiyu.ni@intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103BB609B4@shsmsx102.ccr.corp.intel.com> <12c5b766-09bd-998e-ac1f-74741bf75f33@Intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103BB60C63@shsmsx102.ccr.corp.intel.com> From: "Ni, Ruiyu" Message-ID: <58940e88-f94c-73c4-75b0-58b5e475b271@Intel.com> Date: Tue, 3 Jul 2018 10:16:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483103BB60C63@shsmsx102.ccr.corp.intel.com> Subject: Re: [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: , X-List-Received-Date: Tue, 03 Jul 2018 02:16:47 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 7/3/2018 10:10 AM, Zeng, Star wrote: > So, you mean caller knows ((PixelHeight == 0) || (PixelWidth == 0)), and caller knows TranslateGopBltToBmp will return RETURN_UNSUPPORTED for that? Caller knows an error status may return when any of PixelHeight/PixelWidth is 0. But that's not the reason that I only add debug message for BmpHeader case. For first API: TranslateBmpToGopBlt ( IN VOID *BmpImage, IN UINTN BmpImageSize, IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL **GopBlt, IN OUT UINTN *GopBltSize, OUT UINTN *PixelHeight, OUT UINTN *PixelWidth Caller only needs to read a bmp file from a file system, then passes the buffer to the above API. Caller doesn't know the format of BMP. API checks for that. And using debug message to help caller understand the detailed error reason. For second API: TranslateGopBltToBmp ( IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *GopBlt, IN UINT32 PixelHeight, IN UINT32 PixelWidth, IN OUT VOID **BmpImage, IN OUT UINT32 *BmpImageSize PixelHeight and PixelWidth are parameters. > > > Thanks, > Star > -----Original Message----- > From: Ni, Ruiyu > Sent: Tuesday, July 3, 2018 10:03 AM > To: Zeng, Star ; edk2-devel@lists.01.org > Cc: Kinney, Michael D > Subject: Re: [PATCH 2/2] MdeModulePkg/BmpSupportLib: Check PixelHeight/PixelWidth against 0 > > On 7/2/2018 6:05 PM, Zeng, Star wrote: >> Please add reference to bugzilla link into the commit log. >> >> https://bugzilla.tianocore.org/show_bug.cgi?id=944 > OK >> >> Another, is there any reason to only add debug message for " if ((BmpHeader->PixelHeight == 0) || (BmpHeader->PixelWidth == 0)) { ", but not " if ((PixelHeight == 0) || (PixelWidth == 0)) { " ??? > PixelHeight and PixelWidth are passed in from caller directly. > But when caller passes in BmpImage buffer, it doesn't know the format of the BMP header, so a debug message is shown to tell caller what happens. > > -- > Thanks, > Ray > -- Thanks, Ray