diff
- const BYTE* pDstStart = &pDstData[nXDst * dstBytesPerPixel + nYDst * nDstStep];
+ size_t indexX = nXDst * (size_t)dstBytesPerPixel;
+ size_t indexY = nYDst * (size_t)nDstStep;
+ if (indexX + indexY < indexX || indexX + indexY < indexY) // Check for overflow
+     return FALSE; // or handle error appropriately
+ const BYTE* pDstStart = &pDstData[indexX + indexY];
