Commit 8e87c36b authored by wjia@chromium.org's avatar wjia@chromium.org

fix comparison of StreamDeviceInfoArray.

Need check size of both arrays before calling std::equal.

BUG=141904
Review URL: https://chromiumcodereview.appspot.com/10854099

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151140 0039d316-1c4b-4281-b951-d872f2087c98
parent 65a005a0
...@@ -546,6 +546,7 @@ void MediaStreamManager::DevicesEnumerated( ...@@ -546,6 +546,7 @@ void MediaStreamManager::DevicesEnumerated(
&audio_enumeration_cache_ : &video_enumeration_cache_); &audio_enumeration_cache_ : &video_enumeration_cache_);
if (HasEnumerationRequest(stream_type) && if (HasEnumerationRequest(stream_type) &&
(!cache->valid || (!cache->valid ||
devices.size() != cache->devices.size() ||
!std::equal(devices.begin(), devices.end(), cache->devices.begin(), !std::equal(devices.begin(), devices.end(), cache->devices.begin(),
media_stream::StreamDeviceInfo::IsEqual))) { media_stream::StreamDeviceInfo::IsEqual))) {
cache->valid = true; cache->valid = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment