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

Unified Diff: content/browser/media/capture/desktop_capture_device.cc

Issue 882153005: Fix a null ptr deref crash in DesktopCaptureDevice (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/capture/desktop_capture_device.cc
diff --git a/content/browser/media/capture/desktop_capture_device.cc b/content/browser/media/capture/desktop_capture_device.cc
index 0ddcf2698cae148732a85b5eaa26fb190d661869..fe294216ca729a8efb4794ba3018585b676af097 100644
--- a/content/browser/media/capture/desktop_capture_device.cc
+++ b/content/browser/media/capture/desktop_capture_device.cc
@@ -466,10 +466,14 @@ void DesktopCaptureDevice::StopAndDeAllocate() {
void DesktopCaptureDevice::SetNotificationWindowId(
gfx::NativeViewId window_id) {
- thread_.message_loop_proxy()->PostTask(
- FROM_HERE,
- base::Bind(&Core::SetNotificationWindowId, base::Unretained(core_.get()),
- window_id));
+ // This may be called after the capturer has been stopped.
+ if (thread_.message_loop_proxy()) {
Sergey Ulanov 2015/02/03 17:49:18 I'd prefer checking that core_ is not nullptr here
jiayl 2015/02/03 17:54:09 Done.
+ thread_.message_loop_proxy()->PostTask(
+ FROM_HERE,
+ base::Bind(&Core::SetNotificationWindowId,
+ base::Unretained(core_.get()),
+ window_id));
+ }
}
DesktopCaptureDevice::DesktopCaptureDevice(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698