[Swfdec] 5 commits - libswfdec/swfdec_audio_event.c libswfdec/swfdec_image.c libswfdec/swfdec_movie.c libswfdec/swfdec_video.c libswfdec/swfdec_video_movie.c

Benjamin Otte company at kemper.freedesktop.org
Wed Nov 14 11:00:56 PST 2007


 libswfdec/swfdec_audio_event.c |    4 ++++
 libswfdec/swfdec_image.c       |    1 +
 libswfdec/swfdec_movie.c       |    2 ++
 libswfdec/swfdec_video.c       |    2 ++
 libswfdec/swfdec_video_movie.c |    2 +-
 5 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 622af04a0d5f6f273449b88ab05bd98c36055681
Author: Benjamin Otte <otte at gnome.org>
Date:   Wed Nov 14 19:59:22 2007 +0100

    update the image _after_ unsetting the movie, not before
    
    Otherwise we recompute the first frame for no reason at all

diff --git a/libswfdec/swfdec_video_movie.c b/libswfdec/swfdec_video_movie.c
index f95c2db..a3ebd75 100644
--- a/libswfdec/swfdec_video_movie.c
+++ b/libswfdec/swfdec_video_movie.c
@@ -82,10 +82,10 @@ swfdec_video_movie_unset_input (SwfdecVideoMovie *movie)
   if (movie->input == NULL)
     return;
 
-  swfdec_video_movie_update_image (movie);
   if (movie->input->disconnect)
     movie->input->disconnect (movie->input, movie);
   movie->input = NULL;
+  swfdec_video_movie_update_image (movie);
 }
 
 static void
commit 01734f12306705920fb9de57b683eb0106c16471
Author: Benjamin Otte <otte at gnome.org>
Date:   Wed Nov 14 19:42:37 2007 +0100

    memleak in error path

diff --git a/libswfdec/swfdec_image.c b/libswfdec/swfdec_image.c
index ee6aefc..0b29917 100644
--- a/libswfdec/swfdec_image.c
+++ b/libswfdec/swfdec_image.c
@@ -645,6 +645,7 @@ swfdec_image_create_surface_transformed (SwfdecImage *image, const SwfdecColorTr
   tdata = g_try_malloc (image->width * image->height * 4);
   if (!tdata) {
     SWFDEC_ERROR ("failed to allocate memory for transformed image");
+    cairo_surface_destroy (source);
     return NULL;
   }
   /* FIXME: This code assumes a rowstride of 4 * width */
commit 7cacd5dd24c8b14b45de5bdf6a7679b4884a72c8
Author: Benjamin Otte <otte at gnome.org>
Date:   Wed Nov 14 19:35:24 2007 +0100

    memleak

diff --git a/libswfdec/swfdec_audio_event.c b/libswfdec/swfdec_audio_event.c
index 7f85974..79d01af 100644
--- a/libswfdec/swfdec_audio_event.c
+++ b/libswfdec/swfdec_audio_event.c
@@ -82,6 +82,10 @@ swfdec_audio_event_dispose (GObject *object)
   g_free (audio->envelope);
   audio->envelope = NULL;
   audio->n_envelopes = 0;
+  if (audio->decoded) {
+    swfdec_buffer_unref (audio->decoded);
+    audio->decoded = NULL;
+  }
 
   G_OBJECT_CLASS (swfdec_audio_event_parent_class)->dispose (object);
 }
commit a0b9a26f928e68cd94a0d4665b3b6e8d3a03b78d
Author: Benjamin Otte <otte at gnome.org>
Date:   Wed Nov 14 19:27:46 2007 +0100

    memleak

diff --git a/libswfdec/swfdec_video.c b/libswfdec/swfdec_video.c
index 520960c..7ff8d8f 100644
--- a/libswfdec/swfdec_video.c
+++ b/libswfdec/swfdec_video.c
@@ -128,6 +128,8 @@ swfdec_video_input_disconnect (SwfdecVideoMovieInput *input_, SwfdecVideoMovie *
   g_assert (input->movie == movie);
   if (input->decoder)
     swfdec_video_decoder_free (input->decoder);
+  if (input->surface)
+    cairo_surface_destroy (input->surface);
   g_object_unref (input->video);
   g_slice_free (SwfdecVideoInput, input);
 }
commit 7de195e065f3836b6f3575a968ade12962c9f72d
Author: Benjamin Otte <otte at gnome.org>
Date:   Wed Nov 14 19:12:20 2007 +0100

    huge memleak

diff --git a/libswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c
index 10e0b78..526925f 100644
--- a/libswfdec/swfdec_movie.c
+++ b/libswfdec/swfdec_movie.c
@@ -852,6 +852,8 @@ swfdec_movie_render (SwfdecMovie *movie, cairo_t *cr,
       cairo_pattern_set_matrix (pattern, &matrix);
       cairo_set_source (cr, pattern);
       cairo_paint (cr);
+      cairo_pattern_destroy (pattern);
+      cairo_surface_destroy (surface);
     }
   }
 


More information about the Swfdec mailing list