Index: webrtc/api/webrtcsdp.cc |
diff --git a/webrtc/api/webrtcsdp.cc b/webrtc/api/webrtcsdp.cc |
index 69a1af28adc70a077d73a10e09bb6bf663283b83..e39c350023d1d393ad80a5d96fc50bc2b52ebbcd 100644 |
--- a/webrtc/api/webrtcsdp.cc |
+++ b/webrtc/api/webrtcsdp.cc |
@@ -2597,7 +2597,8 @@ bool ParseContent(const std::string& message, |
<< cricket::kDataMaxBandwidth / 1000 << "kbps."; |
return ParseFailed(line, description.str(), error); |
} |
- media_desc->set_bandwidth(b * 1000); |
+ // Prevent integer overflow. |
+ media_desc->set_bandwidth(b < INT_MAX / 1000 ? b * 1000 : INT_MAX); |
pthatcher1
2016/12/13 23:58:05
Can you put a paren around the thing before "?"?
Taylor Brandstetter
2016/12/14 00:17:01
Done (but using std::min).
|
} |
} |
continue; |