summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-23 19:37:03 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-23 19:37:03 +0000
commit2e29cfcd39de2ca1481c1c016f6889ac2342692a (patch)
treed8dd64748425e0a3c8a2ea8d44e12a57183fb00b /webkit
parent3677a8ce694dc1a1a7e7cf7082ce80dccaf4d412 (diff)
downloadchromium_src-2e29cfcd39de2ca1481c1c016f6889ac2342692a.zip
chromium_src-2e29cfcd39de2ca1481c1c016f6889ac2342692a.tar.gz
chromium_src-2e29cfcd39de2ca1481c1c016f6889ac2342692a.tar.bz2
Check that the ImageData resource handle is valid before giving the resulting
pointer to the specific widget code. BUG=49967 Review URL: http://codereview.chromium.org/2809071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53495 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/plugins/pepper_widget.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/webkit/glue/plugins/pepper_widget.cc b/webkit/glue/plugins/pepper_widget.cc
index 74b0e40..a8a4ee2 100644
--- a/webkit/glue/plugins/pepper_widget.cc
+++ b/webkit/glue/plugins/pepper_widget.cc
@@ -27,7 +27,10 @@ bool Paint(PP_Resource resource, const PP_Rect* rect, PP_Resource image_id) {
return false;
scoped_refptr<ImageData> image(Resource::GetAs<ImageData>(image_id));
- return widget && widget->Paint(rect, image);
+ if (!image)
+ return false;
+
+ return widget->Paint(rect, image);
}
bool HandleEvent(PP_Resource resource, const PP_Event* event) {