Index: remoting/client/plugin/chromoting_instance.cc |
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc |
index a9c1c1e2da4dca170364eee7120436a4c8733f1f..360ed67b20fcdca66437ad268b105f2e5deb9391 100644 |
--- a/remoting/client/plugin/chromoting_instance.cc |
+++ b/remoting/client/plugin/chromoting_instance.cc |
@@ -21,6 +21,7 @@ |
// crbug.com/74951 |
#include "content/renderer/p2p/ipc_network_manager.h" |
#include "content/renderer/p2p/ipc_socket_factory.h" |
+#include "media/base/media.h" |
#include "ppapi/c/dev/ppb_query_policy_dev.h" |
#include "ppapi/cpp/completion_callback.h" |
#include "ppapi/cpp/input_event.h" |
@@ -91,7 +92,9 @@ ChromotingInstance::~ChromotingInstance() { |
// before we can call Detach() on |view_proxy_|. |
context_.Stop(); |
- view_proxy_->Detach(); |
+ if (view_proxy_.get()) { |
+ view_proxy_->Detach(); |
+ } |
} |
bool ChromotingInstance::Init(uint32_t argc, |
@@ -102,6 +105,13 @@ bool ChromotingInstance::Init(uint32_t argc, |
logger_.VLog(1, "Started ChromotingInstance::Init"); |
+ // Check to make sure the media library is initialized. |
+ // http://crbug.com/91521. |
+ if (!media::IsMediaLibraryInitialized()) { |
+ logger_.Log(logging::LOG_ERROR, "Media library not initialized."); |
+ return false; |
+ } |
+ |
// Start all the threads. |
context_.Start(); |