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

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

Issue 2067793003: Fix crash parsing malformed rtp packet (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtp_packet_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f6634867f689e1593cadb5dc5ef2e53bfe22fb04..07aeb7130d586da3d145b497f14dffebff34149a 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_packet.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_packet.cc
@@ -416,10 +416,13 @@ bool Packet::FindExtension(ExtensionType type,
RTC_DCHECK(offset);
for (size_t i = 0; i < num_extensions_; ++i) {
if (extension_entries_[i].type == type) {
- RTC_CHECK_EQ(length, extension_entries_[i].length)
- << "Length mismatch for extension '" << type << "'"
- << "should be " << length << ", received "
- << extension_entries_[i].length;
+ if (length != extension_entries_[i].length) {
+ LOG(LS_WARNING) << "Length mismatch for extension '" << type
+ << "': expected " << static_cast<int>(length)
+ << ", received "
+ << static_cast<int>(extension_entries_[i].length);
+ return false;
+ }
*offset = extension_entries_[i].offset;
return true;
}
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtp_packet_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698