The patch adds check logic to make sure that for a input BMP file,
the width or height is not 0; for a input GOP blt buffer, the width
or height is not 0. Otherwise, UNSUPPORTED status is returned.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
return RETURN_UNSUPPORTED;\r
}\r
\r
return RETURN_UNSUPPORTED;\r
}\r
\r
+ if ((BmpHeader->PixelHeight == 0) || (BmpHeader->PixelWidth == 0)) {\r
+ DEBUG ((DEBUG_ERROR, "TranslateBmpToGopBlt: BmpHeader->PixelHeight or BmpHeader->PixelWidth is 0.\n"));\r
+ return RETURN_UNSUPPORTED;\r
+ }\r
+\r
//\r
// Only support BITMAPINFOHEADER format.\r
// BITMAPFILEHEADER + BITMAPINFOHEADER = BMP_IMAGE_HEADER\r
//\r
// Only support BITMAPINFOHEADER format.\r
// BITMAPFILEHEADER + BITMAPINFOHEADER = BMP_IMAGE_HEADER\r
return RETURN_INVALID_PARAMETER;\r
}\r
\r
return RETURN_INVALID_PARAMETER;\r
}\r
\r
+ if ((PixelHeight == 0) || (PixelWidth == 0)) {\r
+ return RETURN_UNSUPPORTED;\r
+ }\r
+\r
//\r
// Allocate memory for BMP file.\r
//\r
//\r
// Allocate memory for BMP file.\r
//\r