[Swfdec-commits] 2 commits - swfdec/swfdec_resource.c

Benjamin Otte company at kemper.freedesktop.org
Thu Nov 6 07:19:29 PST 2008


 swfdec/swfdec_resource.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 9243cc67c3c9b71344599a27d90a882c7945fb02
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Nov 6 16:18:59 2008 +0100

    fix SEGV when loading multiple resources into the same movie

diff --git a/swfdec/swfdec_resource.c b/swfdec/swfdec_resource.c
index fe79848..b97269f 100644
--- a/swfdec/swfdec_resource.c
+++ b/swfdec/swfdec_resource.c
@@ -72,7 +72,8 @@ swfdec_resource_stream_target_image (SwfdecResource *instance)
   SwfdecPlayer *player = SWFDEC_PLAYER (swfdec_gc_object_get_context (instance));
   SwfdecSpriteMovie *movie = (SwfdecSpriteMovie *) SWFDEC_AS_VALUE_GET_MOVIE (instance->movie);
 
-  if (!SWFDEC_IS_SPRITE_MOVIE (movie) || movie->sprite != NULL)
+  if (!SWFDEC_IS_SPRITE_MOVIE (movie) || movie->sprite != NULL ||
+      swfdec_movie_get_own_resource (SWFDEC_MOVIE (movie)) != instance)
     return;
 
   if (SWFDEC_IS_SWF_DECODER (instance->decoder)) {
commit 0167d67ace40509deeea5371cbae0a9ecf58bbae
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Nov 6 15:55:42 2008 +0100

    movie cannot be NULL here

diff --git a/swfdec/swfdec_resource.c b/swfdec/swfdec_resource.c
index ce59da2..fe79848 100644
--- a/swfdec/swfdec_resource.c
+++ b/swfdec/swfdec_resource.c
@@ -185,8 +185,6 @@ swfdec_resource_replace_movie (SwfdecSpriteMovie *movie, SwfdecResource *resourc
   
   copy = swfdec_movie_new (SWFDEC_PLAYER (swfdec_gc_object_get_context (movie)), 
       mov->depth, mov->parent, resource, NULL, mov->name);
-  if (copy == NULL)
-    return FALSE;
   swfdec_movie_begin_update_matrix (copy);
   copy->matrix = mov->matrix;
   copy->modified = mov->modified;


More information about the Swfdec-commits mailing list