c++
BOOL overlapping(...) {
    if (nXDst + nWidth > UINT32_MAX / dstBytesPerPixel ||
        nYDst + nHeight > UINT32_MAX / nDstStep)  // Check potential bounds
        return FALSE;
        
    // Previous overflow checks (like in patch 1 or 2) still recommended here as well.
    // ... rest of the function
}

