David Benjamin abf1e0bd40 Replace a memcpy with std::copy_n
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}
2024-04-03 12:45:57 +00:00
..
2023-01-10 15:26:37 +00:00
2023-01-10 15:26:37 +00:00
2022-07-05 09:59:33 +00:00
2023-01-10 15:26:37 +00:00
2022-07-05 09:59:33 +00:00
2022-07-05 09:59:33 +00:00
2022-07-05 09:59:33 +00:00
2022-09-30 08:44:30 +00:00
2024-02-26 11:26:04 +00:00