c
size_t xOffset, yOffset;

if (__builtin_mul_overflow(nXDst, dstBytesPerPixel, &xOffset) ||
    __builtin_mul_overflow(nYDst, nDstStep, &yOffset) ||
    __builtin_add_overflow(xOffset, yOffset, &xOffset)) {
    // Handle overflow error
    return NULL;
}

const BYTE* pDstStart = &pDstData[xOffset];
