Index: webrtc/modules/rtp_rtcp/source/rtp_packet.cc |
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_packet.cc b/webrtc/modules/rtp_rtcp/source/rtp_packet.cc |
index 0c28092d4c68a756eec3f67a4cefc4de8e23ed60..7a7c45d38302ca893324003fbd603ee2b34eb3ae 100644 |
--- a/webrtc/modules/rtp_rtcp/source/rtp_packet.cc |
+++ b/webrtc/modules/rtp_rtcp/source/rtp_packet.cc |
@@ -279,12 +279,16 @@ void Packet::SetCsrcs(const std::vector<uint32_t>& csrcs) { |
} |
bool Packet::HasRawExtension(int id) const { |
+ if (id == ExtensionManager::kInvalidId) |
+ return false; |
RTC_DCHECK_GE(id, kMinExtensionId); |
RTC_DCHECK_LE(id, kMaxExtensionId); |
return extension_entries_[id - 1].offset != 0; |
} |
rtc::ArrayView<const uint8_t> Packet::GetRawExtension(int id) const { |
+ if (id == ExtensionManager::kInvalidId) |
+ return nullptr; |
RTC_DCHECK_GE(id, kMinExtensionId); |
RTC_DCHECK_LE(id, kMaxExtensionId); |
const ExtensionInfo& extension = extension_entries_[id - 1]; |
@@ -303,6 +307,8 @@ bool Packet::SetRawExtension(int id, rtc::ArrayView<const uint8_t> data) { |
} |
rtc::ArrayView<uint8_t> Packet::AllocateRawExtension(int id, size_t length) { |
+ if (id == ExtensionManager::kInvalidId) |
+ return nullptr; |
RTC_DCHECK_GE(id, kMinExtensionId); |
RTC_DCHECK_LE(id, kMaxExtensionId); |
RTC_DCHECK_GE(length, 1); |