[Swfdec-commits] 4 commits - swfdec/swfdec_filter_as.c swfdec/swfdec_movie.c swfdec/swfdec_video_movie.c test/trace

Benjamin Otte company at kemper.freedesktop.org
Mon Nov 3 10:24:54 PST 2008


 swfdec/swfdec_filter_as.c                             |    2 
 swfdec/swfdec_movie.c                                 |    2 
 swfdec/swfdec_video_movie.c                           |    6 +
 test/trace/Makefile.am                                |    9 ++
 test/trace/crash-0.9.1-getvariable-shapes-5.swf       |binary
 test/trace/crash-0.9.1-getvariable-shapes-5.swf.trace |    1 
 test/trace/crash-0.9.1-getvariable-shapes-6.swf       |binary
 test/trace/crash-0.9.1-getvariable-shapes-6.swf.trace |    1 
 test/trace/crash-0.9.1-getvariable-shapes-7.swf       |binary
 test/trace/crash-0.9.1-getvariable-shapes-7.swf.trace |    1 
 test/trace/crash-0.9.1-getvariable-shapes-8.swf       |binary
 test/trace/crash-0.9.1-getvariable-shapes-8.swf.trace |    1 
 test/trace/crash-0.9.1-getvariable-shapes.xml         |   68 ++++++++++++++++++
 13 files changed, 87 insertions(+), 4 deletions(-)

New commits:
commit 0459db21bce34e0b909bf8750c7dc643919a721d
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Nov 3 19:23:51 2008 +0100

    fix a potential critical when initializing videos
    
    We need to reorganize our sandboxing model

diff --git a/swfdec/swfdec_video_movie.c b/swfdec/swfdec_video_movie.c
index 8ef6693..68ec7e4 100644
--- a/swfdec/swfdec_video_movie.c
+++ b/swfdec/swfdec_video_movie.c
@@ -122,16 +122,18 @@ swfdec_video_movie_constructor (GType type, guint n_construct_properties,
   GObject *object;
   SwfdecMovie *movie;
   SwfdecVideo *video;
+  gboolean unuse;
 
   object = G_OBJECT_CLASS (swfdec_video_movie_parent_class)->constructor (type, 
       n_construct_properties, construct_properties);
 
   movie = SWFDEC_MOVIE (object);
-  swfdec_sandbox_use (movie->resource->sandbox);
+  unuse = swfdec_sandbox_try_use (movie->resource->sandbox);
   swfdec_video_movie_init_properties (swfdec_gc_object_get_context (movie));
   swfdec_as_object_set_constructor_by_name (SWFDEC_AS_OBJECT (movie), 
       SWFDEC_AS_STR_Video, NULL);
-  swfdec_sandbox_unuse (movie->resource->sandbox);
+  if (unuse)
+    swfdec_sandbox_unuse (movie->resource->sandbox);
 
   video = SWFDEC_VIDEO (movie->graphic);
 
commit 0b3649e703593a3dfec8189da96be9a0b2aad43b
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Nov 3 18:35:59 2008 +0100

    test for recent fix
    
    This test was constructed by taking a swfc file and mangling it with
    swfmill. It looks like it's just not possible to get a semi-useful Flash
    creation tool that makes it useful to create all the Flash files we
    need. I always need to "fix" it with swfmill.

diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index dd3a4c3..228fba4 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -1059,6 +1059,15 @@ EXTRA_DIST = \
 	crash-0.8.0-huffmann-table-8.swf \
 	crash-0.8.0-huffmann-table-8.swf.trace \
 	crash-0.8.0-huffmann-table.xml \
+	crash-0.9.1-getvariable-shapes-5.swf \
+	crash-0.9.1-getvariable-shapes-5.swf.trace \
+	crash-0.9.1-getvariable-shapes-6.swf \
+	crash-0.9.1-getvariable-shapes-6.swf.trace \
+	crash-0.9.1-getvariable-shapes-7.swf \
+	crash-0.9.1-getvariable-shapes-7.swf.trace \
+	crash-0.9.1-getvariable-shapes-8.swf \
+	crash-0.9.1-getvariable-shapes-8.swf.trace \
+	crash-0.9.1-getvariable-shapes.xml \
 	createEmptyMovieClip-events.sc \
 	createEmptyMovieClip-events.swf \
 	createEmptyMovieClip-events.swf.trace \
diff --git a/test/trace/crash-0.9.1-getvariable-shapes-5.swf b/test/trace/crash-0.9.1-getvariable-shapes-5.swf
new file mode 100644
index 0000000..fcd8bc5
Binary files /dev/null and b/test/trace/crash-0.9.1-getvariable-shapes-5.swf differ
diff --git a/test/trace/crash-0.9.1-getvariable-shapes-5.swf.trace b/test/trace/crash-0.9.1-getvariable-shapes-5.swf.trace
new file mode 100644
index 0000000..417b7b5
--- /dev/null
+++ b/test/trace/crash-0.9.1-getvariable-shapes-5.swf.trace
@@ -0,0 +1 @@
+undefined
diff --git a/test/trace/crash-0.9.1-getvariable-shapes-6.swf b/test/trace/crash-0.9.1-getvariable-shapes-6.swf
new file mode 100644
index 0000000..c420c35
Binary files /dev/null and b/test/trace/crash-0.9.1-getvariable-shapes-6.swf differ
diff --git a/test/trace/crash-0.9.1-getvariable-shapes-6.swf.trace b/test/trace/crash-0.9.1-getvariable-shapes-6.swf.trace
new file mode 100644
index 0000000..417b7b5
--- /dev/null
+++ b/test/trace/crash-0.9.1-getvariable-shapes-6.swf.trace
@@ -0,0 +1 @@
+undefined
diff --git a/test/trace/crash-0.9.1-getvariable-shapes-7.swf b/test/trace/crash-0.9.1-getvariable-shapes-7.swf
new file mode 100644
index 0000000..3b3c179
Binary files /dev/null and b/test/trace/crash-0.9.1-getvariable-shapes-7.swf differ
diff --git a/test/trace/crash-0.9.1-getvariable-shapes-7.swf.trace b/test/trace/crash-0.9.1-getvariable-shapes-7.swf.trace
new file mode 100644
index 0000000..417b7b5
--- /dev/null
+++ b/test/trace/crash-0.9.1-getvariable-shapes-7.swf.trace
@@ -0,0 +1 @@
+undefined
diff --git a/test/trace/crash-0.9.1-getvariable-shapes-8.swf b/test/trace/crash-0.9.1-getvariable-shapes-8.swf
new file mode 100644
index 0000000..6bc361d
Binary files /dev/null and b/test/trace/crash-0.9.1-getvariable-shapes-8.swf differ
diff --git a/test/trace/crash-0.9.1-getvariable-shapes-8.swf.trace b/test/trace/crash-0.9.1-getvariable-shapes-8.swf.trace
new file mode 100644
index 0000000..417b7b5
--- /dev/null
+++ b/test/trace/crash-0.9.1-getvariable-shapes-8.swf.trace
@@ -0,0 +1 @@
+undefined
diff --git a/test/trace/crash-0.9.1-getvariable-shapes.xml b/test/trace/crash-0.9.1-getvariable-shapes.xml
new file mode 100644
index 0000000..76b3b3a
--- /dev/null
+++ b/test/trace/crash-0.9.1-getvariable-shapes.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<swf version="8" compressed="1">
+  <Header framerate="1" frames="1">
+    <size>
+      <Rectangle left="0" right="4000" top="0" bottom="3000"/>
+    </size>
+    <tags>
+      <FileAttributes hasMetaData="0" useNetwork="0"/>
+      <DefineShape3 objectID="1">
+        <bounds>
+          <Rectangle left="0" right="1000" top="0" bottom="1000"/>
+        </bounds>
+        <styles>
+          <StyleList>
+            <fillStyles>
+              <Solid>
+                <color>
+                  <Color red="0" green="0" blue="255" alpha="255"/>
+                </color>
+              </Solid>
+            </fillStyles>
+          </StyleList>
+        </styles>
+        <shapes>
+          <Shape>
+            <edges>
+              <ShapeSetup x="0" y="0" fillStyle0="1"/>
+              <LineTo x="1000" y="0"/>
+              <LineTo x="0" y="1000"/>
+              <LineTo x="-1000" y="0"/>
+              <LineTo x="0" y="-1000"/>
+              <ShapeSetup/>
+            </edges>
+          </Shape>
+        </shapes>
+      </DefineShape3>
+      <PlaceObject2 replace="0" depth="1" objectID="1"/>
+      <DoAction>
+        <actions>
+          <Dictionary>
+            <strings>
+              <String value="_root.foo"/>
+              <String value="fscommand:quit"/>
+              <String value=""/>
+            </strings>
+          </Dictionary>
+          <PushData>
+            <items>
+              <StackDictionaryLookup index="0"/>
+            </items>
+          </PushData>
+          <GetVariable/>
+          <Trace/>
+          <PushData>
+            <items>
+              <StackDictionaryLookup index="1"/>
+              <StackDictionaryLookup index="2"/>
+            </items>
+          </PushData>
+          <GetURL2 method="0"/>
+          <EndAction/>
+        </actions>
+      </DoAction>
+      <ShowFrame/>
+      <End/>
+    </tags>
+  </Header>
+</swf>
commit 1b33ed40dd57774b86fb19eea0b08c6c5d97e369
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Nov 3 18:35:10 2008 +0100

    don't crash when looking at movies without script support during get_by_name()

diff --git a/swfdec/swfdec_movie.c b/swfdec/swfdec_movie.c
index 8a3fba9..26b91c4 100644
--- a/swfdec/swfdec_movie.c
+++ b/swfdec/swfdec_movie.c
@@ -1060,7 +1060,7 @@ swfdec_movie_get_by_name (SwfdecMovie *movie, const char *name, gboolean unnamed
       else
 	return movie;
     }
-    if (unnamed && cur->name == SWFDEC_AS_STR_EMPTY) {
+    if (unnamed && cur->name == SWFDEC_AS_STR_EMPTY && cur->as_value) {
       if (swfdec_strcmp (version, cur->as_value->names[cur->as_value->n_names - 1], name) == 0) {
 	/* unnamed movies are always scriptable */
 	return cur;
commit 1bbd1ca44777287545946560d182e4d8762834fa
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Nov 3 17:18:14 2008 +0100

    fix potential crash - filters have been relays for a while

diff --git a/swfdec/swfdec_filter_as.c b/swfdec/swfdec_filter_as.c
index f02108d..2d61d54 100644
--- a/swfdec/swfdec_filter_as.c
+++ b/swfdec/swfdec_filter_as.c
@@ -37,6 +37,6 @@ swfdec_filter_do_clone (SwfdecAsContext *cx, SwfdecAsObject *object,
   SWFDEC_AS_CHECK (SWFDEC_TYPE_FILTER, &filter, "");
 
   filter = swfdec_filter_clone (filter);
-  SWFDEC_AS_VALUE_SET_OBJECT (retval, SWFDEC_AS_OBJECT (filter));
+  SWFDEC_AS_VALUE_SET_OBJECT (retval, swfdec_as_relay_get_as_object (SWFDEC_AS_RELAY (filter)));
 }
 


More information about the Swfdec-commits mailing list