diff --git a/cpp/open3d/io/file_format/FileXYZ.cpp b/cpp/open3d/io/file_format/FileXYZ.cpp index 0a8f8a06a606..c45a663220aa 100644 --- a/cpp/open3d/io/file_format/FileXYZ.cpp +++ b/cpp/open3d/io/file_format/FileXYZ.cpp @@ -164,7 +164,7 @@ bool WritePointCloudInMemoryToXYZ(unsigned char *&buffer, } length = content.length(); buffer = new unsigned char[length]; // we do this for the caller - memcpy(buffer, content.c_str(), length); + std::memcpy(buffer, content.c_str(), length); reporter.Finish(); return true; diff --git a/cpp/pybind/io/class_io.cpp b/cpp/pybind/io/class_io.cpp index 20942c5d68b4..2d7946dc62a0 100644 --- a/cpp/pybind/io/class_io.cpp +++ b/cpp/pybind/io/class_io.cpp @@ -202,7 +202,8 @@ void pybind_class_io(py::module &m_io) { const char *dataptr = PYBIND11_BYTES_AS_STRING(bytes.ptr()); auto length = PYBIND11_BYTES_SIZE(bytes.ptr()); auto buffer = new unsigned char[length]; - memcpy(buffer, dataptr, length); // copy before releasing GIL + // copy before releasing GIL + std::memcpy(buffer, dataptr, length); py::gil_scoped_release release; geometry::PointCloud pcd; ReadPointCloud(reinterpret_cast(buffer),