diff --git a/cpp/open3d/io/file_format/FileXYZ.cpp b/cpp/open3d/io/file_format/FileXYZ.cpp index c8aa76a2b76..d2dc087be37 100644 --- a/cpp/open3d/io/file_format/FileXYZ.cpp +++ b/cpp/open3d/io/file_format/FileXYZ.cpp @@ -145,7 +145,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 671072fef0b..0602f93e577 100644 --- a/cpp/pybind/io/class_io.cpp +++ b/cpp/pybind/io/class_io.cpp @@ -183,7 +183,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),