From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Permerror (SPF Permanent Error: Void lookup limit of 2 exceeded) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1D003222DDC07 for ; Sun, 14 Jan 2018 19:40:59 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jan 2018 19:46:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,361,1511856000"; d="scan'208";a="19601240" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.19]) by FMSMGA003.fm.intel.com with ESMTP; 14 Jan 2018 19:46:16 -0800 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Christian Ehrhardt , Star Zeng Date: Mon, 15 Jan 2018 11:46:12 +0800 Message-Id: <20180115034612.381104-4-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.15.1.windows.2 In-Reply-To: <20180115034612.381104-1-ruiyu.ni@intel.com> References: <20180115034612.381104-1-ruiyu.ni@intel.com> Subject: [PATCH 3/3] MdeModulePkg/FrameBufferBltLib: Fix copying of unaligned memory X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 03:40:59 -0000 Contributed-under: TianoCore Contribution Agreement 1.1 Reported-by: Christian Ehrhardt Signed-off-by: Christian Ehrhardt Cc: Star Zeng Reviewed-by: Ruiyu Ni --- 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