[Swfdec] 2 commits - libswfdec/swfdec_as_interpret.c test/trace

Benjamin Otte company at kemper.freedesktop.org
Mon Oct 29 03:12:26 PDT 2007


 libswfdec/swfdec_as_interpret.c                       |    3 -
 test/trace/Makefile.am                                |    9 +++
 test/trace/crash-0.5.3-text-field-root-variable-5.swf |binary
 test/trace/crash-0.5.3-text-field-root-variable-6.swf |binary
 test/trace/crash-0.5.3-text-field-root-variable-7.swf |binary
 test/trace/crash-0.5.3-text-field-root-variable-8.swf |binary
 test/trace/crash-0.5.3-text-field-root-variable.c     |   47 ++++++++++++++++++
 7 files changed, 58 insertions(+), 1 deletion(-)

New commits:
commit 393c44644a52e50205adb5795edc17a522410717
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Oct 29 10:41:04 2007 +0100

    fix crasher in TextField variable lookup

diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index c331413..13ca787 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -481,7 +481,8 @@ swfdec_action_lookup_object (SwfdecAsContext *cx, SwfdecAsObject *o, const char
   }
 
   if (path[0] == '/') {
-    o = cx->frame->target;
+    if (o == NULL)
+      o = cx->frame->target;
     if (!SWFDEC_IS_MOVIE (o))
       return NULL;
     o = SWFDEC_AS_OBJECT (swfdec_movie_get_root (SWFDEC_MOVIE (o)));
commit d02eabcd04c8d67653cd7cf17ca03616593c8baa
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Oct 29 10:39:45 2007 +0100

    add test for another crasher

diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 2086980..eaa396c 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -383,6 +383,15 @@ EXTRA_DIST = \
 	crash-0.5.3-divide-by-zero.as \
 	crash-0.5.3-divide-by-zero.swf \
 	crash-0.5.3-divide-by-zero.swf.trace \
+	crash-0.5.3-text-field-root-variable.c \
+	crash-0.5.3-text-field-root-variable-5.swf \
+	crash-0.5.3-text-field-root-variable-5.swf.trace \
+	crash-0.5.3-text-field-root-variable-6.swf \
+	crash-0.5.3-text-field-root-variable-6.swf.trace \
+	crash-0.5.3-text-field-root-variable-7.swf \
+	crash-0.5.3-text-field-root-variable-7.swf.trace \
+	crash-0.5.3-text-field-root-variable-8.swf \
+	crash-0.5.3-text-field-root-variable-8.swf.trace \
 	currentframe.swf \
 	currentframe.swf.trace \
 	date.as \
diff --git a/test/trace/crash-0.5.3-text-field-root-variable-5.swf b/test/trace/crash-0.5.3-text-field-root-variable-5.swf
new file mode 100644
index 0000000..676226b
Binary files /dev/null and b/test/trace/crash-0.5.3-text-field-root-variable-5.swf differ
diff --git a/test/trace/crash-0.5.3-text-field-root-variable-5.swf.trace b/test/trace/crash-0.5.3-text-field-root-variable-5.swf.trace
new file mode 100644
index 0000000..e69de29
diff --git a/test/trace/crash-0.5.3-text-field-root-variable-6.swf b/test/trace/crash-0.5.3-text-field-root-variable-6.swf
new file mode 100644
index 0000000..77a041b
Binary files /dev/null and b/test/trace/crash-0.5.3-text-field-root-variable-6.swf differ
diff --git a/test/trace/crash-0.5.3-text-field-root-variable-6.swf.trace b/test/trace/crash-0.5.3-text-field-root-variable-6.swf.trace
new file mode 100644
index 0000000..e69de29
diff --git a/test/trace/crash-0.5.3-text-field-root-variable-7.swf b/test/trace/crash-0.5.3-text-field-root-variable-7.swf
new file mode 100644
index 0000000..b0dc6d9
Binary files /dev/null and b/test/trace/crash-0.5.3-text-field-root-variable-7.swf differ
diff --git a/test/trace/crash-0.5.3-text-field-root-variable-7.swf.trace b/test/trace/crash-0.5.3-text-field-root-variable-7.swf.trace
new file mode 100644
index 0000000..e69de29
diff --git a/test/trace/crash-0.5.3-text-field-root-variable-8.swf b/test/trace/crash-0.5.3-text-field-root-variable-8.swf
new file mode 100644
index 0000000..2037aab
Binary files /dev/null and b/test/trace/crash-0.5.3-text-field-root-variable-8.swf differ
diff --git a/test/trace/crash-0.5.3-text-field-root-variable-8.swf.trace b/test/trace/crash-0.5.3-text-field-root-variable-8.swf.trace
new file mode 100644
index 0000000..e69de29
diff --git a/test/trace/crash-0.5.3-text-field-root-variable.c b/test/trace/crash-0.5.3-text-field-root-variable.c
new file mode 100755
index 0000000..16b01ef
--- /dev/null
+++ b/test/trace/crash-0.5.3-text-field-root-variable.c
@@ -0,0 +1,47 @@
+/* gcc `pkg-config --libs --cflags libming` crash-0.5.3-text-field-root-variable.c -o crash-0.5.3-text-field-root-variable && ./crash-0.5.3-text-field-root-variable
+ */
+
+#include <ming.h>
+
+static void
+do_movie (int version)
+{
+  char name[100];
+  SWFMovie movie;
+  SWFTextField text;
+  SWFDisplayItem display;
+
+  movie = newSWFMovieWithVersion (version);
+  movie = newSWFMovie();
+  SWFMovie_setRate (movie, 1);
+  SWFMovie_setDimension (movie, 200, 150);
+
+  text = newSWFTextField ();
+  SWFTextField_setVariableName (text, "/:foo");
+  display = SWFMovie_add (movie, (SWFBlock) text);
+  SWFMovie_nextFrame (movie);
+
+  SWFMovie_add (movie, (SWFBlock) newSWFAction (
+	"loadMovie (\"FSCommand:quit\", \"\");"
+	));
+  SWFMovie_nextFrame (movie);
+
+  sprintf (name, "crash-0.5.3-text-field-root-variable-%d.swf", version);
+  SWFMovie_save (movie, name);
+}
+
+int
+main (int argc, char **argv)
+{
+  int i;
+
+  if (Ming_init ())
+    return 1;
+
+  for (i = 8; i >= 5; i--) {
+    do_movie (i);
+  }
+
+  return 0;
+}
+


More information about the Swfdec mailing list