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

Side by Side Diff: webrtc/pc/webrtcsdp_unittest.cc

Issue 2676293003: Fix SDP parsing crash due to missing track ID in "a=msid". (Closed)
Patch Set: Rebase 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 unified diff | Download patch
« no previous file with comments | « webrtc/pc/webrtcsdp.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2011 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 3428 matching lines...) Expand 10 before | Expand all | Expand 10 after
3439 "c=IN IP4 0.0.0.0\r\n" 3439 "c=IN IP4 0.0.0.0\r\n"
3440 "a=rtcp:9 IN IP4 0.0.0.0\r\n" 3440 "a=rtcp:9 IN IP4 0.0.0.0\r\n"
3441 "a=ice-ufrag:ufrag_voice\r\na=ice-pwd:pwd_voice\r\n" 3441 "a=ice-ufrag:ufrag_voice\r\na=ice-pwd:pwd_voice\r\n"
3442 "a=rtpmap:111 opus/48000/2\r\n" 3442 "a=rtpmap:111 opus/48000/2\r\n"
3443 "a=candidate:a0+B/1 1 udp 2130706432 192.168.1.5 12345678 typ host " 3443 "a=candidate:a0+B/1 1 udp 2130706432 192.168.1.5 12345678 typ host "
3444 "generation 2 raddr 192.168.1.1 rport 87654321\r\n"; 3444 "generation 2 raddr 192.168.1.1 rport 87654321\r\n";
3445 3445
3446 JsepSessionDescription jdesc_output(kDummyString); 3446 JsepSessionDescription jdesc_output(kDummyString);
3447 EXPECT_FALSE(SdpDeserialize(kSdpWithInvalidCandidatePort, &jdesc_output)); 3447 EXPECT_FALSE(SdpDeserialize(kSdpWithInvalidCandidatePort, &jdesc_output));
3448 } 3448 }
3449
3450 // Test that "a=msid" with a missing track ID is rejected and doesn't crash.
3451 // Regression test for:
3452 // https://bugs.chromium.org/p/chromium/issues/detail?id=686405
3453 TEST_F(WebRtcSdpTest, DeserializeMsidAttributeWithMissingTrackId) {
3454 static const char kSdpWithMissingTrackId[] =
3455 "v=0\r\n"
3456 "o=- 18446744069414584320 18446462598732840960 IN IP4 127.0.0.1\r\n"
3457 "s=-\r\n"
3458 "t=0 0\r\n"
3459 "m=audio 9 RTP/SAVPF 111\r\n"
3460 "c=IN IP4 0.0.0.0\r\n"
3461 "a=rtpmap:111 opus/48000/2\r\n"
3462 "a=msid:stream_id \r\n";
3463
3464 JsepSessionDescription jdesc_output(kDummyString);
3465 EXPECT_FALSE(SdpDeserialize(kSdpWithMissingTrackId, &jdesc_output));
3466 }
3467
3468 TEST_F(WebRtcSdpTest, DeserializeMsidAttributeWithMissingStreamId) {
3469 static const char kSdpWithMissingStreamId[] =
3470 "v=0\r\n"
3471 "o=- 18446744069414584320 18446462598732840960 IN IP4 127.0.0.1\r\n"
3472 "s=-\r\n"
3473 "t=0 0\r\n"
3474 "m=audio 9 RTP/SAVPF 111\r\n"
3475 "c=IN IP4 0.0.0.0\r\n"
3476 "a=rtpmap:111 opus/48000/2\r\n"
3477 "a=msid: track_id\r\n";
3478
3479 JsepSessionDescription jdesc_output(kDummyString);
3480 EXPECT_FALSE(SdpDeserialize(kSdpWithMissingStreamId, &jdesc_output));
3481 }
OLDNEW
« 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