Commit dd165761 authored by dmichael@google.com's avatar dmichael@google.com

Avoid null-pointer dereference for PPAPI Instance BindGraphics.

BUG=None
TEST=NaCl SDK pi_generator example encounters this
Review URL: http://codereview.chromium.org/6384009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72430 0039d316-1c4b-4281-b951-d872f2087c98
parent 67803e1f
...@@ -458,6 +458,10 @@ bool PluginInstance::BindGraphics(PP_Resource graphics_id) { ...@@ -458,6 +458,10 @@ bool PluginInstance::BindGraphics(PP_Resource graphics_id) {
if (bound_graphics_2d()) { if (bound_graphics_2d()) {
// Start the new image with the content of the old image until the plugin // Start the new image with the content of the old image until the plugin
// repaints. // 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 = const SkBitmap* old_backing_bitmap =
bound_graphics_2d()->image_data()->GetMappedBitmap(); bound_graphics_2d()->image_data()->GetMappedBitmap();
SkRect old_size = SkRect::MakeWH( SkRect old_size = SkRect::MakeWH(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment