Bug 778442 - Add some null guards in nsPluginInstanceOwner::GetVisibleRect r=blassey
authorJames Willcox <jwillcox@mozilla.com>
Tue, 11 Sep 2012 10:20:44 -0400
changeset 104797 8bebc4a081795f3569932b4051e3ec4960f2981b
parent 104796 f50654b6b00a42ddae340a3f8e72004f0764566c
child 104798 ef085eb72cd8021f10ab6c2deb28db0cee92a795
push id14686
push userjwillcox@mozilla.com
push dateTue, 11 Sep 2012 14:28:36 +0000
treeherdermozilla-inbound@8bebc4a08179 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs778442
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 778442 - Add some null guards in nsPluginInstanceOwner::GetVisibleRect r=blassey
dom/plugins/base/nsPluginInstanceOwner.cpp
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -1801,16 +1801,19 @@ already_AddRefed<ImageContainer> nsPlugi
   pluginImage->SetData(data);
   container->SetCurrentImageInTransaction(img);
 
   return container.forget();
 }
 
 nsIntRect nsPluginInstanceOwner::GetVisibleRect()
 {
+  if (!mObjectFrame || !mPluginWindow)
+    return nsIntRect(0, 0, 0, 0);
+  
   gfxRect r = nsIntRect(0, 0, mPluginWindow->width, mPluginWindow->height);
 
   float xResolution = mObjectFrame->PresContext()->GetRootPresContext()->PresShell()->GetXResolution();
   float yResolution = mObjectFrame->PresContext()->GetRootPresContext()->PresShell()->GetYResolution();
   r.Scale(xResolution, yResolution);
 
   return nsIntRect(r.x, r.y, r.width, r.height);
 }