Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Commit-Queue: Harald Alvestrand <[email protected]> Reviewed-by: Harald Alvestrand <[email protected]> Cr-Commit-Position: refs/heads/main@{#41989}
- Loading branch information