public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/FrameBufferBltLib: Correctly consider SourceX
@ 2019-09-24 12:46 Marvin Häuser
  2019-09-24 13:01 ` Wu, Hao A
  0 siblings, 1 reply; 4+ messages in thread
From: Marvin Häuser @ 2019-09-24 12:46 UTC (permalink / raw)
  To: devel@edk2.groups.io; +Cc: Jian J Wang, Hao A Wu

From: Marvin Haeuser <mhaeuser@outlook.de>

Currently, SourceX is not considered in the BufferToVideo operation
when the 8-bit pixel format is used. Correctly add the resulting
offset to prevent image corruption.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Marvin Haeuser <mhaeuser@outlook.de>
---
 MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c b/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
index 47c5326e9958..a084cc81d32e 100644
--- a/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
+++ b/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
@@ -504,7 +504,7 @@ FrameBufferBltLibBufferToVideo (
     Destination = Configure->FrameBuffer + Offset;
 
     if (Configure->PixelFormat == PixelBlueGreenRedReserved8BitPerColor) {
-      Source = (UINT8 *) BltBuffer + (SrcY * Delta);
+      Source = (UINT8 *) BltBuffer + (SrcY * Delta) + (SourceX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
     } else {
       for (IndexX = 0; IndexX < Width; IndexX++) {
         Blt =
-- 
2.23.0.windows.1


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

end of thread, other threads:[~2019-09-24 13:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-24 12:46 [PATCH] MdeModulePkg/FrameBufferBltLib: Correctly consider SourceX Marvin Häuser
2019-09-24 13:01 ` Wu, Hao A
2019-09-24 13:14   ` Gao, Zhichao
2019-09-24 13:20     ` Wu, Hao A

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