From f789c0245d292325e7795da14d73a4f4268a1d2e Mon Sep 17 00:00:00 2001 From: Benjamin Smedberg Date: Fri, 19 Jul 2013 10:02:47 -0400 Subject: [PATCH] Bug 889480 - When NP_Initialize fails, we should not try to call NP_Shutdown later, r=gfritzsche --HG-- extra : rebase_source : d6749449a9ef910b65336ce69aa0ad558711f6e7 --- dom/plugins/ipc/PluginModuleParent.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp index 075679cb7a2..91548a8ddc1 100755 --- a/dom/plugins/ipc/PluginModuleParent.cpp +++ b/dom/plugins/ipc/PluginModuleParent.cpp @@ -1192,9 +1192,11 @@ PluginModuleParent::NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs uint32_t flags = 0; if (!CallNP_Initialize(flags, error)) { + mShutdown = true; return NS_ERROR_FAILURE; } else if (*error != NPERR_NO_ERROR) { + mShutdown = true; return NS_OK; } @@ -1220,8 +1222,14 @@ PluginModuleParent::NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error) flags |= kAllowAsyncDrawing; #endif - if (!CallNP_Initialize(flags, error)) + if (!CallNP_Initialize(flags, error)) { + mShutdown = true; return NS_ERROR_FAILURE; + } + if (*error != NPERR_NO_ERROR) { + mShutdown = true; + return NS_OK; + } #if defined XP_WIN // Send the info needed to join the chrome process's audio session to the