fix invalid memory access in dx bitmap code

Change-Id: If3a495ab2db068f37dcee184e61c0c1e66f09666
This commit is contained in:
Markus Mohrhard
2014-08-13 11:34:48 +02:00
parent 5bad93f5d5
commit 2f0259d73f

View File

@@ -552,7 +552,7 @@ namespace dxcanvas
sal_uInt8 *pSrc = (sal_uInt8 *)((((BYTE *)aSurfaceDesc.lpSurface)+(rect.Y1*aSurfaceDesc.lPitch))+rect.X1);
sal_uInt8 *pDst = (sal_uInt8 *)aRes.getArray();
sal_uInt32 nSegmentSizeInBytes = nWidth<<4;
sal_uInt32 nSegmentSizeInBytes = nWidth*4;
for(sal_uInt32 y=0; y<nHeight; ++y)
{
memcpy(pDst,pSrc,nSegmentSizeInBytes);
@@ -568,7 +568,7 @@ namespace dxcanvas
sal_uInt8 *pSrc = (sal_uInt8 *)((((BYTE *)aLockedRect.pBits)+(rect.Y1*aLockedRect.Pitch))+rect.X1);
sal_uInt8 *pDst = (sal_uInt8 *)aRes.getArray();
sal_uInt32 nSegmentSizeInBytes = nWidth<<4;
sal_uInt32 nSegmentSizeInBytes = nWidth*4;
for(sal_uInt32 y=0; y<nHeight; ++y)
{
memcpy(pDst,pSrc,nSegmentSizeInBytes);