memcpy has a bug where it doesn't work with empty slices whose pointer is null. C++ functions in <algorithm> have this bug fixed and, in a good STL, will specialize down to memcpy or memmove anyway. This fixes a bunch of UBSan failures in Chromium, such as https://luci-milo.appspot.com/ui/inv/build-8752767322372882913/test-results?q=RTCEncodedVideoFrameTest.ConstructorCopiesMetadata&sortby=&groupby= See https://davidben.net/2024/01/15/empty-slices.html Bug: chromium:40248746 Change-Id: Ibfb9c4d7b44df53766a16e40fabd0a374140d89c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/344260 Auto-Submit: David Benjamin <davidben@webrtc.org> Commit-Queue: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41989}