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

Unified Diff: webrtc/pc/webrtcsdp.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 | « no previous file | webrtc/pc/webrtcsdp_unittest.cc » ('j') | webrtc/pc/webrtcsdp_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/webrtcsdp.cc
diff --git a/webrtc/pc/webrtcsdp.cc b/webrtc/pc/webrtcsdp.cc
index 11eefe5c3d5098f88ce8a884c5535d7dd14248cf..601e6437d6eb1cc24adb0f5914358f851f8c1347 100644
--- a/webrtc/pc/webrtcsdp.cc
+++ b/webrtc/pc/webrtcsdp.cc
@@ -2122,10 +2122,17 @@ static bool ParseMsidAttribute(const std::string& line,
return ParseFailedExpectFieldNum(line, expected_fields, error);
}
+ if (track_id->empty()) {
+ return ParseFailed(line, "Missing track ID in msid attribute.", error);
+ }
+
// msid:<msid-id>
if (!GetValue(field1, kAttributeMsid, stream_id, error)) {
return false;
}
+ if (stream_id->empty()) {
+ return ParseFailed(line, "Missing stream ID in msid attribute.", error);
+ }
return true;
}
« no previous file with comments | « no previous file | webrtc/pc/webrtcsdp_unittest.cc » ('j') | webrtc/pc/webrtcsdp_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698