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

Unified Diff: content/browser/renderer_host/media/media_stream_dispatcher_host.cc

Issue 2149943002: Improve handling of invalid frame ID in MSDH::OnCancelDeviceChangeNotifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « content/browser/bad_message.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/media_stream_dispatcher_host.cc
diff --git a/content/browser/renderer_host/media/media_stream_dispatcher_host.cc b/content/browser/renderer_host/media/media_stream_dispatcher_host.cc
index dcab5d412b98e794f93567b1cc3da3a983b808b8..5aa187d8cec23ddd50e8b03e2a8080bb03efc4b2 100644
--- a/content/browser/renderer_host/media/media_stream_dispatcher_host.cc
+++ b/content/browser/renderer_host/media/media_stream_dispatcher_host.cc
@@ -8,6 +8,7 @@
#include "base/command_line.h"
#include "base/memory/ptr_util.h"
+#include "content/browser/bad_message.h"
#include "content/browser/browser_main_loop.h"
#include "content/browser/renderer_host/media/media_stream_ui_proxy.h"
#include "content/common/media/media_stream_messages.h"
@@ -275,7 +276,10 @@ void MediaStreamDispatcherHost::OnCancelDeviceChangeNotifications(
[render_frame_id](const DeviceChangeSubscriberInfo& subscriber_info) {
return subscriber_info.render_frame_id == render_frame_id;
});
- CHECK(it != device_change_subscribers_.end());
+ if (it == device_change_subscribers_.end()) {
+ bad_message::ReceivedBadMessage(this, bad_message::MSDH_INVALID_FRAME_ID);
+ return;
+ }
device_change_subscribers_.erase(it);
if (device_change_subscribers_.empty())
media_stream_manager_->CancelDeviceChangeNotifications(this);
« no previous file with comments | « content/browser/bad_message.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698