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

Unified Diff: content/renderer/media/video_capture_impl.cc

Issue 10702160: Merge 146044 - fix use after free case in VideoCaptureImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/video_capture_impl.cc
===================================================================
--- content/renderer/media/video_capture_impl.cc (revision 146244)
+++ content/renderer/media/video_capture_impl.cc (working copy)
@@ -227,7 +227,7 @@
if (it != clients_pending_on_restart_.end()) {
handler->OnStopped(this);
handler->OnRemoved(this);
- clients_pending_on_filter_.erase(it);
+ clients_pending_on_restart_.erase(it);
return;
}
@@ -253,11 +253,12 @@
break;
}
- DCHECK(it != cached_dibs_.end());
- DCHECK_GT(it->second->references, 0);
- it->second->references--;
- if (it->second->references == 0) {
- Send(new VideoCaptureHostMsg_BufferReady(device_id_, it->first));
+ if (it != cached_dibs_.end() && it->second) {
+ DCHECK_GT(it->second->references, 0);
+ it->second->references--;
+ if (it->second->references == 0) {
+ Send(new VideoCaptureHostMsg_BufferReady(device_id_, it->first));
+ }
}
}
« 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