public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Zeng, Star" <star.zeng@intel.com>
To: "Ni, Ruiyu" <ruiyu.ni@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>,
	"Zeng, Star" <star.zeng@intel.com>
Subject: Re: [PATCH 2/2] MdeModulePkg/BmpSupportLib: Check PixelHeight/PixelWidth against 0
Date: Tue, 3 Jul 2018 02:27:54 +0000	[thread overview]
Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BB60CA3@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <58940e88-f94c-73c4-75b0-58b5e475b271@Intel.com>

Ok. Reviewed-by: Star Zeng <star.zeng@intel.com>.


Thanks,
Star
-----Original Message-----
From: Ni, Ruiyu 
Sent: Tuesday, July 3, 2018 10:17 AM
To: Zeng, Star <star.zeng@intel.com>; edk2-devel@lists.01.org
Cc: Kinney, Michael D <michael.d.kinney@intel.com>
Subject: Re: [PATCH 2/2] MdeModulePkg/BmpSupportLib: Check PixelHeight/PixelWidth against 0

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 <star.zeng@intel.com>; edk2-devel@lists.01.org
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>
> 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

      reply	other threads:[~2018-07-03  2:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-25  7:36 [PATCH 0/2] Fix bugs in BmpSupportLib Ruiyu Ni
2018-06-25  7:36 ` [PATCH 1/2] MdeModulePkg/BmpSupportLib: Correct debug message Ruiyu Ni
2018-07-02 10:03   ` Zeng, Star
2018-06-25  7:36 ` [PATCH 2/2] MdeModulePkg/BmpSupportLib: Check PixelHeight/PixelWidth against 0 Ruiyu Ni
2018-07-02 10:05   ` Zeng, Star
2018-07-03  2:02     ` Ni, Ruiyu
2018-07-03  2:10       ` Zeng, Star
2018-07-03  2:16         ` Ni, Ruiyu
2018-07-03  2:27           ` Zeng, Star [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0C09AFA07DD0434D9E2A0C6AEB0483103BB60CA3@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox