| Index: webrtc/api/datachannel.cc
|
| diff --git a/webrtc/api/datachannel.cc b/webrtc/api/datachannel.cc
|
| index 6b13bf2c705ae7152c9ce4fa6edef00f9ce92340..32da5355be79aa9203d1965d1c72a8eb65a6823b 100644
|
| --- a/webrtc/api/datachannel.cc
|
| +++ b/webrtc/api/datachannel.cc
|
| @@ -31,7 +31,7 @@ bool SctpSidAllocator::AllocateSid(rtc::SSLRole role, int* sid) {
|
| int potential_sid = (role == rtc::SSL_CLIENT) ? 0 : 1;
|
| while (!IsSidAvailable(potential_sid)) {
|
| potential_sid += 2;
|
| - if (potential_sid > static_cast<int>(cricket::kMaxSctpSid)) {
|
| + if (potential_sid >= static_cast<int>(cricket::kMaxSctpStreams)) {
|
| return false;
|
| }
|
| }
|
| @@ -57,7 +57,7 @@ void SctpSidAllocator::ReleaseSid(int sid) {
|
| }
|
|
|
| bool SctpSidAllocator::IsSidAvailable(int sid) const {
|
| - if (sid < 0 || sid > static_cast<int>(cricket::kMaxSctpSid)) {
|
| + if (sid < 0 || sid >= static_cast<int>(cricket::kMaxSctpStreams)) {
|
| return false;
|
| }
|
| return used_sids_.find(sid) == used_sids_.end();
|
|
|