From: Ruiyu Ni Date: Mon, 15 Jan 2018 03:44:38 +0000 (+0800) Subject: MdeModulePkg/FrameBufferBltLib: Fix copying of unaligned memory X-Git-Tag: edk2-stable201903~2601 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=0e58b55a46b7e3249306a9371124708c80b13726 MdeModulePkg/FrameBufferBltLib: Fix copying of unaligned memory Contributed-under: TianoCore Contribution Agreement 1.1 Reported-by: Christian Ehrhardt Signed-off-by: Christian Ehrhardt Reviewed-by: Star Zeng Reviewed-by: Ruiyu Ni Tested-by: Christian Ehrhardt --- 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) {