gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Bastiaan Jacques
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-246-g04f168b
Date: Sun, 10 Apr 2011 21:16:36 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  04f168bc465df8e5c92997017c5a6bb984ccfacb (commit)
       via  48337fbebf187f8630411738030fb52213094a6e (commit)
      from  e4e1f99753ff2c112a068747add5c57a31c74be1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=04f168bc465df8e5c92997017c5a6bb984ccfacb


commit 04f168bc465df8e5c92997017c5a6bb984ccfacb
Author: Bastiaan Jacques <address@hidden>
Date:   Sun Apr 10 23:11:44 2011 +0200

    Fix null pointer dereference. Bug #32965.

diff --git a/plugin/npapi/plugin.cpp b/plugin/npapi/plugin.cpp
index bc81aa6..4806872 100644
--- a/plugin/npapi/plugin.cpp
+++ b/plugin/npapi/plugin.cpp
@@ -430,7 +430,7 @@ nsPluginInstance::nsPluginInstance(nsPluginCreateData* data)
         _params[name] = val;
     }
 
-    if (NPNFuncs.version >= 14) { // since NPAPI start to support
+    if (HasScripting()) {
         _scriptObject = (GnashPluginScriptObject*) NPN_CreateObject( _instance,
             GnashPluginScriptObject::marshalGetNPClass());
     }
@@ -1325,8 +1325,10 @@ nsPluginInstance::startProc()
         return NPERR_GENERIC_ERROR;
     }
 
-    _scriptObject->setControlFD(p2c_controlpipe[1]);
-    _scriptObject->setHostFD(c2p_pipe[0]);
+    if (HasScripting() && _scriptObject) {
+        _scriptObject->setControlFD(p2c_controlpipe[1]);
+        _scriptObject->setHostFD(c2p_pipe[0]);
+    }
     
     // Setup the command line for starting Gnash
 

http://git.savannah.gnu.org/cgit//commit/?id=48337fbebf187f8630411738030fb52213094a6e


commit 48337fbebf187f8630411738030fb52213094a6e
Author: Bastiaan Jacques <address@hidden>
Date:   Sun Apr 10 23:07:03 2011 +0200

    Don't try scripting the plugin without NPAPI support, but still try it 
without getvalueforurl. Bug #32965.

diff --git a/plugin/npapi/plugin.cpp b/plugin/npapi/plugin.cpp
index edd90fe..bc81aa6 100644
--- a/plugin/npapi/plugin.cpp
+++ b/plugin/npapi/plugin.cpp
@@ -385,6 +385,12 @@ NS_DestroyPluginInstance(nsPluginInstanceBase* aPlugin)
 
 namespace gnash {
 
+inline bool HasScripting()
+{
+    return (NPNFuncs.version >= NPVERS_HAS_NPRUNTIME_SCRIPTING);
+}
+
+
 //
 // nsPluginInstance class implementation
 //
@@ -856,6 +862,11 @@ nsPluginInstance::processPlayerRequest()
         } else if (invoke->name == "addMethod") {
             
             assert(!invoke->args.empty());
+
+            if (!HasScripting()) {
+               LOG_ONCE(log_debug("Ignoring addMethod, no scripting."));
+               continue;
+            }
             // Make this flash function accessible to Javascript. The
             // actual callback lives in libcore/movie_root, but it
             // needs to be on the list of supported remote methods so
@@ -867,6 +878,11 @@ nsPluginInstance::processPlayerRequest()
             this->getScriptObject()->AddMethod(id, remoteCallback);
             continue;
         }
+
+        if (!HasScripting()) {
+           LOG_ONCE(log_debug("Ignoring invoke, no scripting."));
+           continue;
+        }
         
         NPVariant result;
         VOID_TO_NPVARIANT(result);
@@ -1000,6 +1016,11 @@ nsPluginInstance::getDocumentProp(const std::string& 
propname) const
 {
     std::string rv;
 
+    if (!HasScripting()) {
+        LOG_ONCE( gnash::log_debug("Browser doesn't support scripting") );
+        return rv;
+    }
+
     NPObject* windowobj;
     NPError err = NPN_GetValue(_instance, NPNVWindowNPObject, &windowobj);
     if (err != NPERR_NO_ERROR || !windowobj) {
@@ -1047,20 +1068,6 @@ nsPluginInstance::getDocumentProp(const std::string& 
propname) const
 void
 nsPluginInstance::setupCookies(const std::string& pageurl)
 {
-    // In pre xulrunner 1.9, (Firefox 3.1) this function does not exist,
-    // so we can't use it to read the cookie file. For older browsers
-    // like IceWeasel on Debian lenny, which pre dates the cookie support
-    // in NPAPI, you have to block all Cookie for sites like YouTube to
-    // allow Gnash to work.
-#if NPAPI_VERSION != 190
-    if (!NPNFuncs.getvalueforurl) {
-        LOG_ONCE( gnash::log_debug("Browser doesn't support reading cookies") 
);
-        return;
-    }
-#else
-    LOG_ONCE( log_debug("Browser doesn't support reading cookies via NPAPI.") 
);
-#endif
-
     // Cookie appear to drop anything past the domain, so we strip
     // that off.
     std::string::size_type pos;
@@ -1072,11 +1079,14 @@ nsPluginInstance::setupCookies(const std::string& 
pageurl)
     char *cookie = 0;
     uint32_t length = 0;
 
-#if NPAPI_VERSION != 190
-    NPError rv = NPN_GetValueForURL(_instance, NPNURLVCookie, url.c_str(),
-                       &cookie, &length);
-#else
     NPError rv = NPERR_GENERIC_ERROR;
+#if NPAPI_VERSION != 190
+    if (NPNFuncs.getvalueforurl) {
+        rv = NPN_GetValueForURL(_instance, NPNURLVCookie, url.c_str(),
+                                &cookie, &length);
+    } else {
+        LOG_ONCE( gnash::log_debug("Browser doesn't support getvalueforurl") );
+    }
 #endif
 
     // Firefox does not (always) return the cookies that are associated

-----------------------------------------------------------------------

Summary of changes:
 plugin/npapi/plugin.cpp |   54 ++++++++++++++++++++++++++++------------------
 1 files changed, 33 insertions(+), 21 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]