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)); |
+} |