MdeModulePkg/FrameBufferBltLib: Fix copying of unaligned memory
authorRuiyu Ni <ruiyu.ni@intel.com>
Mon, 15 Jan 2018 03:44:38 +0000 (11:44 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Tue, 16 Jan 2018 05:26:56 +0000 (13:26 +0800)
Contributed-under: TianoCore Contribution Agreement 1.1
Reported-by: Christian Ehrhardt <ehrhardt@genua.de>
Signed-off-by: Christian Ehrhardt <ehrhardt@genua.de>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Tested-by: Christian Ehrhardt <ehrhardt@genua.de>
MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.c

index c884698..78dc0c0 100644 (file)
@@ -280,6 +280,7 @@ FrameBufferBltLibVideoFill (
     SizeInBytes = WidthInBytes * Height;\r
     if (SizeInBytes >= 8) {\r
       SetMem32 (Destination, SizeInBytes & ~3, (UINT32) WideFill);\r
+      Destination += SizeInBytes & ~3;\r
       SizeInBytes &= 3;\r
     }\r
     if (SizeInBytes > 0) {\r
@@ -297,6 +298,7 @@ FrameBufferBltLibVideoFill (
         SizeInBytes = WidthInBytes;\r
         if (SizeInBytes >= 8) {\r
           SetMem64 (Destination, SizeInBytes & ~7, WideFill);\r
+          Destination += SizeInBytes & ~7;\r
           SizeInBytes &= 7;\r
         }\r
         if (SizeInBytes > 0) {\r