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

Unified Diff: content/browser/renderer_host/backing_store_mac.mm

Issue 10905036: Pepper Flash Mac: Fix crash when playing video on MB retina (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: disable test on windows Created 8 years, 4 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 | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/backing_store_mac.mm
diff --git a/content/browser/renderer_host/backing_store_mac.mm b/content/browser/renderer_host/backing_store_mac.mm
index 5e17e5fe024ad3e1c31dedb141323be1ae0e64ed..19411393d7fa8c7be1fb82b4bb0d17819a0c20ec 100644
--- a/content/browser/renderer_host/backing_store_mac.mm
+++ b/content/browser/renderer_host/backing_store_mac.mm
@@ -87,9 +87,13 @@ void BackingStoreMac::PaintToBackingStore(
gfx::Size pixel_size = size().Scale(device_scale_factor_);
gfx::Rect pixel_bitmap_rect = bitmap_rect.Scale(scale_factor);
+ size_t bitmap_byte_count =
+ pixel_bitmap_rect.width() * pixel_bitmap_rect.height() * 4;
+ DCHECK_GE(dib->size(), bitmap_byte_count);
+
base::mac::ScopedCFTypeRef<CGDataProviderRef> data_provider(
CGDataProviderCreateWithData(NULL, dib->memory(),
- pixel_bitmap_rect.width() * pixel_bitmap_rect.height() * 4, NULL));
+ bitmap_byte_count, NULL));
base::mac::ScopedCFTypeRef<CGImageRef> bitmap_image(
CGImageCreate(pixel_bitmap_rect.width(), pixel_bitmap_rect.height(),
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698