[edk2] [PATCH 3/3] MdeModulePkg/FrameBufferBltLib: Fix copying of unaligned memory

Ruiyu Ni posted 3 patches 6 years, 11 months ago
[edk2] [PATCH 3/3] MdeModulePkg/FrameBufferBltLib: Fix copying of unaligned memory
Posted by Ruiyu Ni 6 years, 11 months ago
Contributed-under: TianoCore Contribution Agreement 1.1
Reported-by: Christian Ehrhardt <ehrhardt@genua.de>
Signed-off-by: Christian Ehrhardt <ehrhardt@genua.de>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
---
 MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c b/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
index c88469859b..78dc0c0b51 100644
--- a/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
+++ b/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
@@ -280,6 +280,7 @@ FrameBufferBltLibVideoFill (
     SizeInBytes = WidthInBytes * Height;
     if (SizeInBytes >= 8) {
       SetMem32 (Destination, SizeInBytes & ~3, (UINT32) WideFill);
+      Destination += SizeInBytes & ~3;
       SizeInBytes &= 3;
     }
     if (SizeInBytes > 0) {
@@ -297,6 +298,7 @@ FrameBufferBltLibVideoFill (
         SizeInBytes = WidthInBytes;
         if (SizeInBytes >= 8) {
           SetMem64 (Destination, SizeInBytes & ~7, WideFill);
+          Destination += SizeInBytes & ~7;
           SizeInBytes &= 7;
         }
         if (SizeInBytes > 0) {
-- 
2.15.1.windows.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 3/3] MdeModulePkg/FrameBufferBltLib: Fix copying of unaligned memory
Posted by Zeng, Star 6 years, 11 months ago
Reviewed-by: Star Zeng <star.zeng@intel.com>

Thanks,
Star
-----Original Message-----
From: Ni, Ruiyu 
Sent: Monday, January 15, 2018 11:46 AM
To: edk2-devel@lists.01.org
Cc: Christian Ehrhardt <ehrhardt@genua.de>; Zeng, Star <star.zeng@intel.com>
Subject: [PATCH 3/3] MdeModulePkg/FrameBufferBltLib: Fix copying of unaligned memory

Contributed-under: TianoCore Contribution Agreement 1.1
Reported-by: Christian Ehrhardt <ehrhardt@genua.de>
Signed-off-by: Christian Ehrhardt <ehrhardt@genua.de>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
---
 MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c b/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
index c88469859b..78dc0c0b51 100644
--- a/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
+++ b/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c
@@ -280,6 +280,7 @@ FrameBufferBltLibVideoFill (
     SizeInBytes = WidthInBytes * Height;
     if (SizeInBytes >= 8) {
       SetMem32 (Destination, SizeInBytes & ~3, (UINT32) WideFill);
+      Destination += SizeInBytes & ~3;
       SizeInBytes &= 3;
     }
     if (SizeInBytes > 0) {
@@ -297,6 +298,7 @@ FrameBufferBltLibVideoFill (
         SizeInBytes = WidthInBytes;
         if (SizeInBytes >= 8) {
           SetMem64 (Destination, SizeInBytes & ~7, WideFill);
+          Destination += SizeInBytes & ~7;
           SizeInBytes &= 7;
         }
         if (SizeInBytes > 0) {
-- 
2.15.1.windows.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel