c
static INLINE BOOL overlapping(...) { // ... parameters as before
    UINT32 offset1 = nXDst * dstBytesPerPixel;
    if (offset1 / dstBytesPerPixel != nXDst)  return FALSE; // Overflow check

    UINT32 offset2 = nYDst * nDstStep;
    if (offset2 / nDstStep != nYDst) return FALSE; // Overflow check

    UINT32 offset = offset1 + offset2;
    if (offset < offset1) return FALSE; // Overflow check on addition

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