| Index: content/renderer/media/media_stream_center.cc
|
| ===================================================================
|
| --- content/renderer/media/media_stream_center.cc (revision 148953)
|
| +++ content/renderer/media/media_stream_center.cc (working copy)
|
| @@ -8,6 +8,7 @@
|
|
|
| #include "base/logging.h"
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "base/string_number_conversions.h"
|
| #include "base/utf_string_conversions.h"
|
| #include "content/renderer/media/media_stream_impl.h"
|
| #include "content/renderer/media/media_stream_extra_data.h"
|
| @@ -141,8 +142,14 @@
|
|
|
| WebKit::WebString MediaStreamCenter::constructSDP(
|
| const WebKit::WebICECandidateDescriptor& candidate) {
|
| + int m_line_index = -1;
|
| + if (!base::StringToInt(UTF16ToUTF8(candidate.label()), &m_line_index)) {
|
| + LOG(ERROR) << "Invalid candidate label: " << UTF16ToUTF8(candidate.label());
|
| + return WebKit::WebString();
|
| + }
|
| scoped_ptr<webrtc::IceCandidateInterface> native_candidate(
|
| webrtc::CreateIceCandidate(UTF16ToUTF8(candidate.label()),
|
| + m_line_index,
|
| UTF16ToUTF8(candidate.candidateLine())));
|
| std::string sdp;
|
| if (!native_candidate->ToString(&sdp))
|
| @@ -159,8 +166,15 @@
|
|
|
| for (size_t i = 0; i < description.numberOfAddedCandidates(); ++i) {
|
| WebKit::WebICECandidateDescriptor candidate = description.candidate(i);
|
| + int m_line_index = -1;
|
| + if (!base::StringToInt(UTF16ToUTF8(candidate.label()), &m_line_index)) {
|
| + LOG(ERROR) << "Invalid candidate label: "
|
| + << UTF16ToUTF8(candidate.label());
|
| + continue;
|
| + }
|
| scoped_ptr<webrtc::IceCandidateInterface> native_candidate(
|
| webrtc::CreateIceCandidate(UTF16ToUTF8(candidate.label()),
|
| + m_line_index,
|
| UTF16ToUTF8(candidate.candidateLine())));
|
| native_desc->AddCandidate(native_candidate.get());
|
| }
|
|
|