Some of the logo files we received for the group that makes our assets like 
this (not sure what tool they were created with) look like they pad the BMP 
size to 8 bytes.

TranslateBmpToGopBlt: invalid BmpImage...
   BmpHeader->Size: 0xE1038
   BmpHeader->ImageOffset: 0x36
   BmpImageSize: 0xE1038
   DataSize: 0xE1000
TranslateBmpToGopBlt: invalid BmpImage...
   BmpHeader->Size: 0x2A3038
   BmpHeader->ImageOffset: 0x36
   BmpImageSize: 0x2A3038
   DataSize: 0x2A3000
TranslateBmpToGopBlt: invalid BmpImage...
   BmpHeader->Size: 0x5EEC38
   BmpHeader->ImageOffset: 0x36
   BmpImageSize: 0x5EEC38
   DataSize: 0x5EEC00

So, each of these has 2 bytes of padding at the end of the file. We could write 
a tool that would do the same size recalculation in order to update the size in 
the header and remove the two bytes but it seems that this is a valid BMP file 
and it doesn't seem correct that UEFI is rejecting it. I can update the commit 
message with more context if needed as well.


Thanks,

Jeff

________________________________
From: Laszlo Ersek <ler...@redhat.com>
Sent: Wednesday, March 24, 2021 5:31 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>; bret.barke...@microsoft.com 
<bret.barke...@microsoft.com>; Jeff Brasen <jbra...@nvidia.com>
Cc: jian.j.w...@intel.com <jian.j.w...@intel.com>; ao.a...@intel.com 
<ao.a...@intel.com>
Subject: Re: [EXTERNAL] [edk2-devel] [PATCH 1/1] MdeModulePkg/BmpSupportLib: 
Allow BMP with extra data

External email: Use caution opening links or attachments


On 03/23/21 18:41, Bret Barkelew via groups.io wrote:
> Is this a *good* idea?
>
> What is considered valid extra data? If it’s immaterial to the FW displaying 
> the image, our policy has been to strip it off BEFORE adding it to the FW 
> image.

Not counting any potential security aspects, stripping out undisplayed
portions helps with flash usage too (I think?), so at least some
concrete justification in the commit message would be nice...

Thanks
Laszlo

>
> - Bret
>
> From: Jeff Brasen via groups.io<mailto:jbrasen=nvidia....@groups.io>
> Sent: Tuesday, March 23, 2021 10:29 AM
> To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
> Cc: jian.j.w...@intel.com<mailto:jian.j.w...@intel.com>; 
> ao.a...@intel.com<mailto:ao.a...@intel.com>; Jeff 
> Brasen<mailto:jbra...@nvidia.com>
> Subject: [EXTERNAL] [edk2-devel] [PATCH 1/1] MdeModulePkg/BmpSupportLib: 
> Allow BMP with extra data
>
> Add support for processing BMP data that contains extra data after the
> image array, this data will not be parsed in anyway in the library but
> images that contain this will not be rejected from processing.
>
> ---
>  MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c 
> b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
> index 3ac31f6723d0..944d01fe7cdf 100644
> --- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
> +++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
> @@ -213,7 +213,7 @@ TranslateBmpToGopBlt (
>
>    if ((BmpHeader->Size != BmpImageSize) ||
>        (BmpHeader->Size < BmpHeader->ImageOffset) ||
> -      (BmpHeader->Size - BmpHeader->ImageOffset != DataSize)) {
> +      (BmpHeader->Size - BmpHeader->ImageOffset < DataSize)) {
>
>      DEBUG ((DEBUG_ERROR, "TranslateBmpToGopBlt: invalid BmpImage... \n"));
>      DEBUG ((DEBUG_ERROR, "   BmpHeader->Size: 0x%x\n", BmpHeader->Size));
> --
> 2.25.1
>
>
>
>
>
>
>
>
> 
>
>
>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73212): https://edk2.groups.io/g/devel/message/73212
Mute This Topic: https://groups.io/mt/81556871/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to