X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FLibrary%2FBaseBmpSupportLib%2FBmpSupportLib.c;h=6196262d143b40f8e56eff191dd1d4c6edde1574;hp=2c23e2c61c963fc94e878c5e77accf186987996d;hb=51fe5b5140ba9ecb168fb03da328983355880c7a;hpb=2a9e1b97c9a86a736707388fe5e22cb75c378b35 diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c index 2c23e2c61c..6196262d14 100644 --- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c +++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c @@ -148,6 +148,11 @@ TranslateBmpToGopBlt ( return RETURN_UNSUPPORTED; } + if ((BmpHeader->PixelHeight == 0) || (BmpHeader->PixelWidth == 0)) { + DEBUG ((DEBUG_ERROR, "TranslateBmpToGopBlt: BmpHeader->PixelHeight or BmpHeader->PixelWidth is 0.\n")); + return RETURN_UNSUPPORTED; + } + // // Only support BITMAPINFOHEADER format. // BITMAPFILEHEADER + BITMAPINFOHEADER = BMP_IMAGE_HEADER @@ -484,6 +489,10 @@ TranslateGopBltToBmp ( return RETURN_INVALID_PARAMETER; } + if ((PixelHeight == 0) || (PixelWidth == 0)) { + return RETURN_UNSUPPORTED; + } + // // Allocate memory for BMP file. //