Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_packet.h

Issue 2871813003: Add write support for the RtpStreamId and RepairedRtpStreamId header extensions. (Closed)
Patch Set: Patch 3 Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/rtp_packet.h
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_packet.h b/webrtc/modules/rtp_rtcp/source/rtp_packet.h
index ca189dbe0d23bbe0c8f9da3dacf7649425aed235..0901fc2506270538c8297e840153c64a0a2181b8 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_packet.h
+++ b/webrtc/modules/rtp_rtcp/source/rtp_packet.h
@@ -183,7 +183,10 @@ bool Packet::GetExtension(Values... values) const {
template <typename Extension, typename... Values>
bool Packet::SetExtension(Values... values) {
- auto buffer = AllocateExtension(Extension::kId, Extension::kValueSizeBytes);
+ const size_t value_size = Extension::ValueSize(values...);
+ if (value_size == 0 || value_size > 16)
+ return false;
+ auto buffer = AllocateExtension(Extension::kId, value_size);
if (buffer.empty())
return false;
return Extension::Write(buffer.data(), values...);
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_packet_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698