public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH EDK2 v1 0/1] MdeModulePkg/BaseBmpSupportLib: Fix ColorMap issue
@ 2022-08-11  8:31 wenyi,xie
  2022-08-11  8:31 ` [PATCH EDK2 v1 1/1] " wenyi,xie
  0 siblings, 1 reply; 5+ messages in thread
From: wenyi,xie @ 2022-08-11  8:31 UTC (permalink / raw)
  To: devel, jian.j.wang, gaoliming, zhichao.gao, ray.ni
  Cc: songdongkuang, xiewenyi2

Main Changes :
1.Add check to catch the issue when format of bmp file is error.

Wenyi Xie (1):
  MdeModulePkg/BaseBmpSupportLib: Fix ColorMap issue

 MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c | 5 +++++
 1 file changed, 5 insertions(+)

-- 
2.20.1.windows.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH EDK2 v1 1/1] MdeModulePkg/BaseBmpSupportLib: Fix ColorMap issue
  2022-08-11  8:31 [PATCH EDK2 v1 0/1] MdeModulePkg/BaseBmpSupportLib: Fix ColorMap issue wenyi,xie
@ 2022-08-11  8:31 ` wenyi,xie
  2022-08-12  4:52   ` 回复: " gaoliming
       [not found]   ` <170A7FD7925DB3CB.15571@groups.io>
  0 siblings, 2 replies; 5+ messages in thread
From: wenyi,xie @ 2022-08-11  8:31 UTC (permalink / raw)
  To: devel, jian.j.wang, gaoliming, zhichao.gao, ray.ni
  Cc: songdongkuang, xiewenyi2

When BitPerPixel is 1,4,8, there should be a color map in bmp file. But if
the format of bmp file is error, it maybe has no color map when BitPerPixel
is 1,4,8. The condition checking now can not catch this issue.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
---
 MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
index c5e885d7a6d5..bea89d530de6 100644
--- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
+++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
@@ -236,6 +236,11 @@ TranslateBmpToGopBlt (
     return RETURN_UNSUPPORTED;
   }
 
+  if ((BmpHeader->ImageOffset == sizeof (BMP_IMAGE_HEADER)) &&
+      ((BmpHeader->BitPerPixel & 0x0D) != 0)) {
+    return RETURN_UNSUPPORTED;
+  }
+
   if (BmpHeader->ImageOffset > sizeof (BMP_IMAGE_HEADER)) {
     switch (BmpHeader->BitPerPixel) {
       case 1:
-- 
2.20.1.windows.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* 回复: [PATCH EDK2 v1 1/1] MdeModulePkg/BaseBmpSupportLib: Fix ColorMap issue
  2022-08-11  8:31 ` [PATCH EDK2 v1 1/1] " wenyi,xie
@ 2022-08-12  4:52   ` gaoliming
       [not found]   ` <170A7FD7925DB3CB.15571@groups.io>
  1 sibling, 0 replies; 5+ messages in thread
From: gaoliming @ 2022-08-12  4:52 UTC (permalink / raw)
  To: 'Wenyi Xie', devel, jian.j.wang, zhichao.gao, ray.ni
  Cc: songdongkuang

Agree this fix to add the check for this case. Reviewed-by: Liming Gao
<gaoliming@byosoft.com.cn>

Thanks
Liming
> -----邮件原件-----
> 发件人: Wenyi Xie <xiewenyi2@huawei.com>
> 发送时间: 2022年8月11日 16:32
> 收件人: devel@edk2.groups.io; jian.j.wang@intel.com;
> gaoliming@byosoft.com.cn; zhichao.gao@intel.com; ray.ni@intel.com
> 抄送: songdongkuang@huawei.com; xiewenyi2@huawei.com
> 主题: [PATCH EDK2 v1 1/1] MdeModulePkg/BaseBmpSupportLib: Fix
> ColorMap issue
> 
> When BitPerPixel is 1,4,8, there should be a color map in bmp file. But if
> the format of bmp file is error, it maybe has no color map when
BitPerPixel
> is 1,4,8. The condition checking now can not catch this issue.
> 
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
> ---
>  MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
> b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
> index c5e885d7a6d5..bea89d530de6 100644
> --- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
> +++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
> @@ -236,6 +236,11 @@ TranslateBmpToGopBlt (
>      return RETURN_UNSUPPORTED;
>    }
> 
> +  if ((BmpHeader->ImageOffset == sizeof (BMP_IMAGE_HEADER)) &&
> +      ((BmpHeader->BitPerPixel & 0x0D) != 0)) {
> +    return RETURN_UNSUPPORTED;
> +  }
> +
>    if (BmpHeader->ImageOffset > sizeof (BMP_IMAGE_HEADER)) {
>      switch (BmpHeader->BitPerPixel) {
>        case 1:
> --
> 2.20.1.windows.1




^ permalink raw reply	[flat|nested] 5+ messages in thread

* 回复: [edk2-devel] 回复: [PATCH EDK2 v1 1/1] MdeModulePkg/BaseBmpSupportLib: Fix ColorMap issue
       [not found]   ` <170A7FD7925DB3CB.15571@groups.io>
@ 2022-08-17  7:34     ` gaoliming
  2022-08-31  8:23       ` wenyi,xie
  0 siblings, 1 reply; 5+ messages in thread
From: gaoliming @ 2022-08-17  7:34 UTC (permalink / raw)
  To: devel, gaoliming, 'Wenyi Xie', jian.j.wang, zhichao.gao,
	ray.ni
  Cc: songdongkuang

Weiyi:
  This patch doesn't pass CI. Please check
https://github.com/tianocore/edk2/pull/3208

> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 gaoliming via
> groups.io
> 发送时间: 2022年8月12日 12:53
> 收件人: 'Wenyi Xie' <xiewenyi2@huawei.com>; devel@edk2.groups.io;
> jian.j.wang@intel.com; zhichao.gao@intel.com; ray.ni@intel.com
> 抄送: songdongkuang@huawei.com
> 主题: [edk2-devel] 回复: [PATCH EDK2 v1 1/1]
> MdeModulePkg/BaseBmpSupportLib: Fix ColorMap issue
> 
> Agree this fix to add the check for this case. Reviewed-by: Liming Gao
> <gaoliming@byosoft.com.cn>
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: Wenyi Xie <xiewenyi2@huawei.com>
> > 发送时间: 2022年8月11日 16:32
> > 收件人: devel@edk2.groups.io; jian.j.wang@intel.com;
> > gaoliming@byosoft.com.cn; zhichao.gao@intel.com; ray.ni@intel.com
> > 抄送: songdongkuang@huawei.com; xiewenyi2@huawei.com
> > 主题: [PATCH EDK2 v1 1/1] MdeModulePkg/BaseBmpSupportLib: Fix
> > ColorMap issue
> >
> > When BitPerPixel is 1,4,8, there should be a color map in bmp file. But
if
> > the format of bmp file is error, it maybe has no color map when
> BitPerPixel
> > is 1,4,8. The condition checking now can not catch this issue.
> >
> > Cc: Jian J Wang <jian.j.wang@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Zhichao Gao <zhichao.gao@intel.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
> > ---
> >  MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
> > b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
> > index c5e885d7a6d5..bea89d530de6 100644
> > --- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
> > +++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
> > @@ -236,6 +236,11 @@ TranslateBmpToGopBlt (
> >      return RETURN_UNSUPPORTED;
> >    }
> >
> > +  if ((BmpHeader->ImageOffset == sizeof (BMP_IMAGE_HEADER)) &&
> > +      ((BmpHeader->BitPerPixel & 0x0D) != 0)) {
> > +    return RETURN_UNSUPPORTED;
> > +  }
> > +
> >    if (BmpHeader->ImageOffset > sizeof (BMP_IMAGE_HEADER)) {
> >      switch (BmpHeader->BitPerPixel) {
> >        case 1:
> > --
> > 2.20.1.windows.1
> 
> 
> 
> 
> 
> 
> 




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 回复: [edk2-devel] 回复: [PATCH EDK2 v1 1/1] MdeModulePkg/BaseBmpSupportLib: Fix ColorMap issue
  2022-08-17  7:34     ` 回复: [edk2-devel] " gaoliming
@ 2022-08-31  8:23       ` wenyi,xie
  0 siblings, 0 replies; 5+ messages in thread
From: wenyi,xie @ 2022-08-31  8:23 UTC (permalink / raw)
  To: gaoliming, devel, jian.j.wang, zhichao.gao, ray.ni; +Cc: songdongkuang

Hi, Liming:

  This patch didn't pass CI because it had a format problem. I had run Uncrustify locally to fixed it and sent a new patch in 8/18.

Thanks
Wenyi

On 2022/8/17 15:34, gaoliming wrote:
> Weiyi:
>   This patch doesn't pass CI. Please check
> https://github.com/tianocore/edk2/pull/3208
> 
>> -----邮件原件-----
>> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 gaoliming via
>> groups.io
>> 发送时间: 2022年8月12日 12:53
>> 收件人: 'Wenyi Xie' <xiewenyi2@huawei.com>; devel@edk2.groups.io;
>> jian.j.wang@intel.com; zhichao.gao@intel.com; ray.ni@intel.com
>> 抄送: songdongkuang@huawei.com
>> 主题: [edk2-devel] 回复: [PATCH EDK2 v1 1/1]
>> MdeModulePkg/BaseBmpSupportLib: Fix ColorMap issue
>>
>> Agree this fix to add the check for this case. Reviewed-by: Liming Gao
>> <gaoliming@byosoft.com.cn>
>>
>> Thanks
>> Liming
>>> -----邮件原件-----
>>> 发件人: Wenyi Xie <xiewenyi2@huawei.com>
>>> 发送时间: 2022年8月11日 16:32
>>> 收件人: devel@edk2.groups.io; jian.j.wang@intel.com;
>>> gaoliming@byosoft.com.cn; zhichao.gao@intel.com; ray.ni@intel.com
>>> 抄送: songdongkuang@huawei.com; xiewenyi2@huawei.com
>>> 主题: [PATCH EDK2 v1 1/1] MdeModulePkg/BaseBmpSupportLib: Fix
>>> ColorMap issue
>>>
>>> When BitPerPixel is 1,4,8, there should be a color map in bmp file. But
> if
>>> the format of bmp file is error, it maybe has no color map when
>> BitPerPixel
>>> is 1,4,8. The condition checking now can not catch this issue.
>>>
>>> Cc: Jian J Wang <jian.j.wang@intel.com>
>>> Cc: Liming Gao <gaoliming@byosoft.com.cn>
>>> Cc: Zhichao Gao <zhichao.gao@intel.com>
>>> Cc: Ray Ni <ray.ni@intel.com>
>>> Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
>>> ---
>>>  MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c | 5 +++++
>>>  1 file changed, 5 insertions(+)
>>>
>>> diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
>>> b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
>>> index c5e885d7a6d5..bea89d530de6 100644
>>> --- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
>>> +++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
>>> @@ -236,6 +236,11 @@ TranslateBmpToGopBlt (
>>>      return RETURN_UNSUPPORTED;
>>>    }
>>>
>>> +  if ((BmpHeader->ImageOffset == sizeof (BMP_IMAGE_HEADER)) &&
>>> +      ((BmpHeader->BitPerPixel & 0x0D) != 0)) {
>>> +    return RETURN_UNSUPPORTED;
>>> +  }
>>> +
>>>    if (BmpHeader->ImageOffset > sizeof (BMP_IMAGE_HEADER)) {
>>>      switch (BmpHeader->BitPerPixel) {
>>>        case 1:
>>> --
>>> 2.20.1.windows.1
>>
>>
>>
>>
>>
>> 
>>
> 
> 
> 
> .
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-31  8:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-11  8:31 [PATCH EDK2 v1 0/1] MdeModulePkg/BaseBmpSupportLib: Fix ColorMap issue wenyi,xie
2022-08-11  8:31 ` [PATCH EDK2 v1 1/1] " wenyi,xie
2022-08-12  4:52   ` 回复: " gaoliming
     [not found]   ` <170A7FD7925DB3CB.15571@groups.io>
2022-08-17  7:34     ` 回复: [edk2-devel] " gaoliming
2022-08-31  8:23       ` wenyi,xie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox