c
static INLINE BOOL overlapping(const BYTE* pDstData, UINT32 nXDst, UINT32 nYDst, UINT32 nDstStep,
                               UINT32 dstBytesPerPixel, const BYTE* pSrcData, UINT32 nXSrc,
                               UINT32 nYSrc, UINT32 nSrcStep, UINT32 srcBytesPerPixel,
                               UINT32 nWidth, UINT32 nHeight)
{
    size_t offset = (size_t)nXDst * dstBytesPerPixel + (size_t)nYDst * nDstStep;

    if (offset > UINT32_MAX) // Check for overflow
        return FALSE;

    const BYTE* pDstStart = &pDstData[(UINT32)offset];
    // ... rest of the function
}
