[Swfdec-commits] 4 commits - swfdec/swfdec_movie.c swfdec/swfdec_player.c swfdec/swfdec_player_internal.h swfdec/swfdec_policy_file.c swfdec/swfdec_resource.c test/trace

Benjamin Otte company at kemper.freedesktop.org
Mon Jan 28 09:05:29 PST 2008


 swfdec/swfdec_movie.c                    |    2 +-
 swfdec/swfdec_player.c                   |   10 ++++++++++
 swfdec/swfdec_player_internal.h          |    1 +
 swfdec/swfdec_policy_file.c              |    5 +++--
 swfdec/swfdec_resource.c                 |    1 +
 test/trace/Makefile.am                   |    3 +++
 test/trace/crash-0.5.5-cvs-truncated.swf |binary
 test/trace/crash-0.5.5-cvs-truncated.xml |   11 +++++++++++
 8 files changed, 30 insertions(+), 3 deletions(-)

New commits:
commit 5c8eddf89df0a461737f2fb5eb82a8c0ac141608
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Jan 28 18:02:50 2008 +0100

    only start ticking in the player when we have a frame
    
    This decouples starting to tick from setting width/height/rate,
    so I hope it doesn't cause issues

diff --git a/swfdec/swfdec_player.c b/swfdec/swfdec_player.c
index 419a6b8..21560a4 100644
--- a/swfdec/swfdec_player.c
+++ b/swfdec/swfdec_player.c
@@ -2069,7 +2069,17 @@ swfdec_player_initialize (SwfdecPlayer *player, guint rate, guint width, guint h
   priv->broadcasted_width = priv->internal_width = priv->stage_width >= 0 ? (guint) priv->stage_width : priv->width;
   priv->broadcasted_height = priv->internal_height = priv->stage_height >= 0 ? (guint) priv->stage_height : priv->height;
   swfdec_player_update_scale (player);
+}
+
+void
+swfdec_player_start_ticking (SwfdecPlayer *player)
+{
+  SwfdecPlayerPrivate *priv;
+
+  g_return_if_fail (SWFDEC_IS_PLAYER (player));
+  g_return_if_fail (player->priv->initialized);
 
+  priv = player->priv;
   priv->iterate_timeout.timestamp = priv->time + SWFDEC_TICKS_PER_SECOND * 256 / priv->rate / 10;
   swfdec_player_add_timeout (player, &priv->iterate_timeout);
   SWFDEC_LOG ("initialized iterate timeout %p to %"G_GUINT64_FORMAT" (now %"G_GUINT64_FORMAT")",
diff --git a/swfdec/swfdec_player_internal.h b/swfdec/swfdec_player_internal.h
index 453ce3d..e371391 100644
--- a/swfdec/swfdec_player_internal.h
+++ b/swfdec/swfdec_player_internal.h
@@ -147,6 +147,7 @@ void		swfdec_player_initialize	(SwfdecPlayer *		player,
 						 guint			rate,
 						 guint			width,
 						 guint			height);
+void		swfdec_player_start_ticking	(SwfdecPlayer *		player);
 void		swfdec_player_add_movie		(SwfdecPlayer *		player,
 						 guint			depth,
 						 const char *		url);
diff --git a/swfdec/swfdec_resource.c b/swfdec/swfdec_resource.c
index 2ea802f..9f13c21 100644
--- a/swfdec/swfdec_resource.c
+++ b/swfdec/swfdec_resource.c
@@ -89,6 +89,7 @@ swfdec_resource_stream_target_image (SwfdecResource *instance)
       if (swfdec_resource_is_root (instance)) {
 	swfdec_movie_initialize (SWFDEC_MOVIE (movie));
 	swfdec_player_perform_actions (player);
+	swfdec_player_start_ticking (player);
       }
     } else {
       SWFDEC_FIXME ("cannot continue loading %s, invalid rights", 
commit 701d8600851d95f9f28addf2f153f0d18a6e36ee
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Jan 28 17:56:42 2008 +0100

    swfdec_xml_new_no_properties requires a sandbox, so give it one

diff --git a/swfdec/swfdec_policy_file.c b/swfdec/swfdec_policy_file.c
index 80fd599..890494d 100644
--- a/swfdec/swfdec_policy_file.c
+++ b/swfdec/swfdec_policy_file.c
@@ -58,7 +58,10 @@ swfdec_policy_file_parse (SwfdecPolicyFile *file, const char *text)
   g_return_if_fail (SWFDEC_IS_POLICY_FILE (file));
   g_return_if_fail (text != NULL);
 
+  /* FIXME: the sandboxes are a HACK */
+  swfdec_sandbox_use (SWFDEC_MOVIE (file->player->priv->roots->data)->resource->sandbox);
   xml = swfdec_xml_new_no_properties (SWFDEC_AS_CONTEXT (file->player), text, TRUE);
+  swfdec_sandbox_unuse (SWFDEC_MOVIE (file->player->priv->roots->data)->resource->sandbox);
 
   if (xml == NULL) {
     SWFDEC_ERROR ("failed to create an XML object for crossdomain policy");
@@ -170,8 +173,6 @@ swfdec_policy_file_target_close (SwfdecStreamTarget *target,
   SwfdecPolicyFile *file = SWFDEC_POLICY_FILE (target);
   char *text;
 
-  swfdec_stream_set_target (stream, NULL);
-  file->stream = NULL;
   if (SWFDEC_IS_LOADER (stream)) {
     text = swfdec_loader_get_text (SWFDEC_LOADER (stream), 8);
   } else {
commit 61959910121ae00709183c9b90299a45a1ff8b1c
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Jan 28 17:31:45 2008 +0100

    add another crasher

diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index d60c270..b052f14 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -641,6 +641,9 @@ EXTRA_DIST = \
 	crash-0.5.5-cvs-_global-7.swf.trace \
 	crash-0.5.5-cvs-_global-8.swf \
 	crash-0.5.5-cvs-_global-8.swf.trace \
+	crash-0.5.5-cvs-truncated.swf \
+	crash-0.5.5-cvs-truncated.swf.trace \
+	crash-0.5.5-cvs-truncated.xml \
 	currentframe.swf \
 	currentframe.swf.trace \
 	dangling-compare.as \
diff --git a/test/trace/crash-0.5.5-cvs-truncated.swf b/test/trace/crash-0.5.5-cvs-truncated.swf
new file mode 100644
index 0000000..ff49d2a
Binary files /dev/null and b/test/trace/crash-0.5.5-cvs-truncated.swf differ
diff --git a/test/trace/crash-0.5.5-cvs-truncated.swf.trace b/test/trace/crash-0.5.5-cvs-truncated.swf.trace
new file mode 100644
index 0000000..e69de29
diff --git a/test/trace/crash-0.5.5-cvs-truncated.xml b/test/trace/crash-0.5.5-cvs-truncated.xml
new file mode 100644
index 0000000..2e67f69
--- /dev/null
+++ b/test/trace/crash-0.5.5-cvs-truncated.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<swf version="6" compressed="0">
+  <Header framerate="12" frames="1119">
+    <size>
+      <Rectangle left="0" right="4000" top="0" bottom="3000"/>
+    </size>
+    <tags>
+      <End/>
+    </tags>
+  </Header>
+</swf>
commit e7bf73d7fe5c185d968f67ac5b181f21d8d84415
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Jan 28 16:37:50 2008 +0100

    don't crash on lookup of _global (fixes recent testcase)

diff --git a/swfdec/swfdec_movie.c b/swfdec/swfdec_movie.c
index 10662c5..c4d0b55 100644
--- a/swfdec/swfdec_movie.c
+++ b/swfdec/swfdec_movie.c
@@ -1137,7 +1137,7 @@ swfdec_movie_get_variable (SwfdecAsObject *object, SwfdecAsObject *orig,
 
   /* FIXME: check that this is correct */
   if (object->context->version > 5 && variable == SWFDEC_AS_STR__global) {
-    SWFDEC_AS_VALUE_SET_OBJECT (val, object->context->global);
+    SWFDEC_AS_VALUE_SET_OBJECT (val, SWFDEC_AS_OBJECT (movie->resource->sandbox));
     *flags = 0;
     return TRUE;
   }


More information about the Swfdec-commits mailing list