From c61725c982d7571615b4fc19fb55c49f426f8207 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Thu, 7 Jun 2012 11:52:12 +0100 Subject: [PATCH] schroedinger: fix video codec state leaks --- ext/schroedinger/gstschrodec.c | 4 +++- ext/schroedinger/gstschroenc.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/schroedinger/gstschrodec.c b/ext/schroedinger/gstschrodec.c index 475a788..77ce8a3 100644 --- a/ext/schroedinger/gstschrodec.c +++ b/ext/schroedinger/gstschrodec.c @@ -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); } diff --git a/ext/schroedinger/gstschroenc.c b/ext/schroedinger/gstschroenc.c index cdab5ab..48907a4 100644 --- a/ext/schroedinger/gstschroenc.c +++ b/ext/schroedinger/gstschroenc.c @@ -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); } -- 2.7.4