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

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 6384009: Avoid null-pointer dereference for PPAPI Instance BindGraphics.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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: webkit/plugins/ppapi/ppapi_plugin_instance.cc
===================================================================
--- webkit/plugins/ppapi/ppapi_plugin_instance.cc (revision 72376)
+++ webkit/plugins/ppapi/ppapi_plugin_instance.cc (working copy)
@@ -458,6 +458,10 @@
if (bound_graphics_2d()) {
// Start the new image with the content of the old image until the plugin
// repaints.
+ // Use ImageDataAutoMapper to ensure the image data is valid.
+ ImageDataAutoMapper mapper(bound_graphics_2d()->image_data());
+ if (!mapper.is_valid())
+ return false;
const SkBitmap* old_backing_bitmap =
bound_graphics_2d()->image_data()->GetMappedBitmap();
SkRect old_size = SkRect::MakeWH(
« 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