schroedinger: fix video codec state leaks
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 7 Jun 2012 10:52:12 +0000 (11:52 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 7 Jun 2012 11:43:45 +0000 (12:43 +0100)
ext/schroedinger/gstschrodec.c
ext/schroedinger/gstschroenc.c

index 475a788..77ce8a3 100644 (file)
@@ -198,7 +198,7 @@ parse_sequence_header (GstSchroDec * schro_dec, guint8 * data, int size)
 {
   SchroVideoFormat video_format;
   int ret;
-  GstVideoCodecState *state;
+  GstVideoCodecState *state = NULL;
   int bit_depth;
   GstVideoFormat fmt = GST_VIDEO_FORMAT_UNKNOWN;
 
@@ -259,6 +259,8 @@ parse_sequence_header (GstSchroDec * schro_dec, guint8 * data, int size)
       state->info.par_d);
 
 beach:
+  if (state)
+    gst_video_codec_state_unref (state);
   gst_schrodec_send_tags (schro_dec);
 }
 
index cdab5ab..48907a4 100644 (file)
@@ -242,6 +242,8 @@ gst_schro_enc_finalize (GObject * object)
     g_free (schro_enc->video_format);
     schro_enc->video_format = NULL;
   }
+  if (schro_enc->input_state)
+    gst_video_codec_state_unref (schro_enc->input_state);
 
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }