Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_view_aura.cc |
| diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc |
| index f52e90f609c6e3437d88536214b4c669dc10e4ce..46195d145f540965764e6002ee206c8d1d8f31f7 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_aura.cc |
| +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc |
| @@ -1585,7 +1585,16 @@ void RenderWidgetHostViewAura::SwapSoftwareFrame( |
| new base::SharedMemory(frame_data->handle, true)); |
| #endif |
| - if (!shared_memory->Map(size_in_bytes)) { |
| + if (!shared_memory->Map(0)) { |
| + DLOG(ERROR) << "Unable to map renderer memory."; |
| + RecordAction(UserMetricsAction("BadMessageTerminate_RWHVA1")); |
| + host_->GetProcess()->ReceivedBadMessage(); |
|
piman
2013/10/23 00:10:15
TBH this could fail if we're out of address space
|
| + return; |
| + } |
| + |
| + if (shared_memory->mapped_size() < size_in_bytes) { |
| + DLOG(ERROR) << "Shared memory too small for given rectangle"; |
| + RecordAction(UserMetricsAction("BadMessageTerminate_RWHVA2")); |
| host_->GetProcess()->ReceivedBadMessage(); |
| return; |
| } |