From: "gaoliming" <gaoliming@byosoft.com.cn>
To: "'Wenyi Xie'" <xiewenyi2@huawei.com>, <devel@edk2.groups.io>,
<jian.j.wang@intel.com>, <zhichao.gao@intel.com>,
<ray.ni@intel.com>
Cc: <songdongkuang@huawei.com>
Subject: 回复: [PATCH EDK2 v1 1/1] MdeModulePkg/BaseBmpSupportLib: Fix ColorMap issue
Date: Fri, 12 Aug 2022 12:52:46 +0800 [thread overview]
Message-ID: <018201d8ae07$5da10f30$18e32d90$@byosoft.com.cn> (raw)
In-Reply-To: <20220811083146.3954530-2-xiewenyi2@huawei.com>
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
next prev parent reply other threads:[~2022-08-12 4:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
[not found] ` <170A7FD7925DB3CB.15571@groups.io>
2022-08-17 7:34 ` 回复: [edk2-devel] 回复: " gaoliming
2022-08-31 8:23 ` wenyi,xie
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='018201d8ae07$5da10f30$18e32d90$@byosoft.com.cn' \
--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