Bug 1880804 [wpt PR 44645] - Implement constructor in RTCEncodedVideoFrame, a=testonly
[gecko.git] / third_party / libwebrtc / moz-patch-stack / 0055.patch
blobbf521807fe283d4c9ca5f3fb336bcf15c3e55cee
1 From: Michael Froman <mjfroman@mac.com>
2 Date: Fri, 8 Apr 2022 11:36:36 -0500
3 Subject: Bug 1766646 - (fix-b556b08668) avoid InlinedVector method that can
4 throw exception
6 ---
7 api/video_codecs/video_encoder.cc | 8 ++++++++
8 1 file changed, 8 insertions(+)
10 diff --git a/api/video_codecs/video_encoder.cc b/api/video_codecs/video_encoder.cc
11 index b0fe078b37..d2de985d5c 100644
12 --- a/api/video_codecs/video_encoder.cc
13 +++ b/api/video_codecs/video_encoder.cc
14 @@ -180,7 +180,15 @@ std::string VideoEncoder::EncoderInfo::ToString() const {
15 for (size_t i = 0; i < preferred_pixel_formats.size(); ++i) {
16 if (i > 0)
17 oss << ", ";
18 +#if defined(WEBRTC_MOZILLA_BUILD)
19 + // This could assert, as opposed to throw using the form in the
20 + // else, but since we're in a for loop that uses .size() we can
21 + // be fairly sure that this is safe without doing a further
22 + // check to make sure 'i' is in-range.
23 + oss << VideoFrameBufferTypeToString(preferred_pixel_formats[i]);
24 +#else
25 oss << VideoFrameBufferTypeToString(preferred_pixel_formats.at(i));
26 +#endif
28 oss << "]";
29 if (is_qp_trusted.has_value()) {