Spanify the memcpy in RTCEncodedVideoFrameDelegate::CreateDataBuffer
In addition to being bounds-safe, it avoids an issue with memcpy and empty inputs (see https://davidben.net/2024/01/15/empty-slices.html) This fixes the UBSan warning below: https://ci.chromium.org/ui/labs/p/chromium/inv/build-8738203517420344721/test/ninja%3A%2F%2Fthird_party%2Fblink%2Frenderer%2Fcontroller%3Ablink_unittests%2FRTCEncodedVideoFrameTest.PassWebRTCDetachesFrameData/variant/603704313003e25d?resultIndex=0 Bug: 40248746 Change-Id: I585728564d9f389d268b66a6730fae5a7f9eeb03 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5827021 Auto-Submit: David Benjamin <davidben@chromium.org> Reviewed-by:Harald Alvestrand <hta@chromium.org> Commit-Queue: David Benjamin <davidben@chromium.org> Commit-Queue: Harald Alvestrand <hta@chromium.org> Cr-Commit-Position: refs/heads/main@{#1349426}
Loading
Please register or sign in to comment