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

Unified Diff: webrtc/pc/webrtcsdp_unittest.cc

Issue 2676293003: Fix SDP parsing crash due to missing track ID in "a=msid". (Closed)
Patch Set: Created 3 years, 10 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 | « webrtc/pc/webrtcsdp.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/webrtcsdp_unittest.cc
diff --git a/webrtc/pc/webrtcsdp_unittest.cc b/webrtc/pc/webrtcsdp_unittest.cc
index 81a5aaf4fe65634bb5bf78b66d08fe46425aeeee..85b0ca085d7667cfeb3118d4f7e854aa044fd231 100644
--- a/webrtc/pc/webrtcsdp_unittest.cc
+++ b/webrtc/pc/webrtcsdp_unittest.cc
@@ -3424,3 +3424,22 @@ TEST_F(WebRtcSdpTest, IceCredentialsInCandidateStringIgnored) {
EXPECT_EQ("ufrag_voice", c.username());
EXPECT_EQ("pwd_voice", c.password());
}
+
+// Test that "a=msid" with a missing track ID is rejected and doesn't crash.
+// Regression test for:
+// https://bugs.chromium.org/p/chromium/issues/detail?id=686405
pthatcher1 2017/02/10 18:14:30 Do we need a test for a missing stream id?
Taylor Brandstetter 2017/02/10 18:29:12 Sure, why not.
+TEST_F(WebRtcSdpTest, DeserializeMsidAttributeWithMissingTrackId) {
+ static const char kSdpWithMissingTrackId[] =
+ "v=0\r\n"
+ "o=- 18446744069414584320 18446462598732840960 IN IP4 127.0.0.1\r\n"
+ "s=-\r\n"
+ "t=0 0\r\n"
+ "m=audio 9 RTP/SAVPF 111\r\n"
+ "c=IN IP4 0.0.0.0\r\n"
+ "a=rtpmap:111 opus/48000/2\r\n"
+ "a=msid:stream_id \r\n";
+
+ JsepSessionDescription jdesc_output(kDummyString);
+ EXPECT_FALSE(
+ SdpDeserialize(kSdpWithMissingTrackId, &jdesc_output));
+}
« no previous file with comments | « webrtc/pc/webrtcsdp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698