[Swfdec] 2 commits - libswfdec/swfdec_js_xml.c libswfdec/swfdec_script.c

Benjamin Otte company at kemper.freedesktop.org
Thu May 24 15:31:41 PDT 2007


 libswfdec/swfdec_js_xml.c |    2 +-
 libswfdec/swfdec_script.c |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
diff-tree a87056c00a0b17289d65d1f00800eff3a992b5fb (from 71eef74d1407f91166b8aee2837555f6fb49ae19)
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon May 14 16:04:29 2007 +0200

    make sure we have the right object without crashing (fixes Gnome #438048)

diff --git a/libswfdec/swfdec_js_xml.c b/libswfdec/swfdec_js_xml.c
index 59632b6..92da66e 100644
--- a/libswfdec/swfdec_js_xml.c
+++ b/libswfdec/swfdec_js_xml.c
@@ -32,7 +32,7 @@ swfdec_js_xml_load (JSContext *cx, JSObj
   SwfdecXml *xml;
   const char *url;
 
-  xml = JS_GetPrivate (cx, obj);
+  xml = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_XML);
   if (xml == NULL)
     return JS_TRUE;
   url = swfdec_js_to_string (cx, argv[0]);
diff-tree 71eef74d1407f91166b8aee2837555f6fb49ae19 (from a2d36ad31bc38cf1092f08fbded125afe22534e1)
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon May 14 14:24:04 2007 +0200

    use the right variable in Delete action

diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c
index a1ed9db..19e0764 100644
--- a/libswfdec/swfdec_script.c
+++ b/libswfdec/swfdec_script.c
@@ -1956,10 +1956,10 @@ swfdec_action_delete (JSContext *cx, gui
 {
   const char *name;
   
-  cx->fp->sp -= 2;
-  name = swfdec_js_to_string (cx, cx->fp->sp[1]);
+  name = swfdec_js_to_string (cx, cx->fp->sp[-1]);
   if (name == NULL)
     return JS_FALSE;
+  cx->fp->sp -= 2;
   if (!JSVAL_IS_OBJECT (cx->fp->sp[0]))
     return JS_TRUE;
   return JS_DeleteProperty (cx, JSVAL_TO_OBJECT (cx->fp->sp[0]), name);
@@ -1973,13 +1973,13 @@ swfdec_action_delete2 (JSContext *cx, gu
   JSProperty *prop;
   JSAtom *atom;
   
-  cx->fp->sp -= 1;
-  name = swfdec_js_to_string (cx, cx->fp->sp[1]);
+  name = swfdec_js_to_string (cx, cx->fp->sp[-1]);
   if (name == NULL)
     return JS_FALSE;
   if (!(atom = js_Atomize (cx, name, strlen (name), 0)) ||
       !js_FindProperty (cx, (jsid) atom, &obj, &pobj, &prop))
     return JS_FALSE;
+  cx->fp->sp -= 1;
   if (!pobj)
     return JS_TRUE;
   return JS_DeleteProperty (cx, pobj, name);


More information about the Swfdec mailing list