Bug 1198663 - Tolerate null Image in Android NPAPI plugins. r=snorp, a=lizzard
authorRobert O'Callahan <robert@ocallahan.org>
Mon, 23 Nov 2015 15:03:00 +1300
changeset 317099 e575218cea33b886d764752d6819b067c76f2c4b
parent 317098 ee34a0965c04f8e3f3853d18a63cb4c6a2846811
child 317100 fcbcabd1ca3bf53ee7efd9a9fa490ec3596315c1
push id8643
push usermconley@mozilla.com
push dateTue, 22 Dec 2015 18:28:20 +0000
reviewerssnorp, lizzard
bugs1198663
milestone44.0a2
Bug 1198663 - Tolerate null Image in Android NPAPI plugins. r=snorp, a=lizzard
dom/plugins/base/nsPluginInstanceOwner.cpp
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -245,19 +245,20 @@ nsPluginInstanceOwner::GetImageContainer
   container = LayerManager::CreateImageContainer();
 
   // Try to get it as an EGLImage first.
   RefPtr<Image> img;
   AttachToContainerAsEGLImage(container, mInstance, r, &img);
   if (!img) {
     AttachToContainerAsSurfaceTexture(container, mInstance, r, &img);
   }
-  MOZ_ASSERT(img);
-
-  container->SetCurrentImageInTransaction(img);
+
+  if (img) {
+    container->SetCurrentImageInTransaction(img);
+  }
 #else
   mInstance->GetImageContainer(getter_AddRefs(container));
 #endif
 
   return container.forget();
 }
 
 void