From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (unknown [134.134.136.20]) (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 99ABC221F93BC for ; Mon, 15 Jan 2018 21:13:09 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2018 21:18:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,366,1511856000"; d="scan'208";a="10555710" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga007.fm.intel.com with ESMTP; 15 Jan 2018 21:18:28 -0800 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 15 Jan 2018 21:18:27 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 15 Jan 2018 21:18:27 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.189]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Tue, 16 Jan 2018 13:18:25 +0800 From: "Zeng, Star" To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" CC: Christian Ehrhardt , "Zeng, Star" Thread-Topic: [PATCH 3/3] MdeModulePkg/FrameBufferBltLib: Fix copying of unaligned memory Thread-Index: AQHTjbNnSDmiQ/4e4UKFcdnUTiQV3KN1929Q Date: Tue, 16 Jan 2018 05:18:24 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B9FC6C4@shsmsx102.ccr.corp.intel.com> References: <20180115034612.381104-1-ruiyu.ni@intel.com> <20180115034612.381104-4-ruiyu.ni@intel.com> In-Reply-To: <20180115034612.381104-4-ruiyu.ni@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: Tue, 16 Jan 2018 05:13:10 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng Thanks, Star -----Original Message----- From: Ni, Ruiyu=20 Sent: Monday, January 15, 2018 11:46 AM To: edk2-devel@lists.01.org Cc: Christian Ehrhardt ; Zeng, Star Subject: [PATCH 3/3] MdeModulePkg/FrameBufferBltLib: Fix copying of unalign= ed memory 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/M= deModulePkg/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 =3D WidthInBytes * Height; if (SizeInBytes >=3D 8) { SetMem32 (Destination, SizeInBytes & ~3, (UINT32) WideFill); + Destination +=3D SizeInBytes & ~3; SizeInBytes &=3D 3; } if (SizeInBytes > 0) { @@ -297,6 +298,7 @@ FrameBufferBltLibVideoFill ( SizeInBytes =3D WidthInBytes; if (SizeInBytes >=3D 8) { SetMem64 (Destination, SizeInBytes & ~7, WideFill); + Destination +=3D SizeInBytes & ~7; SizeInBytes &=3D 7; } if (SizeInBytes > 0) { --=20 2.15.1.windows.2