summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2012-06-07 12:33:31 +0100
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2012-06-07 12:43:59 +0100
commit27486729d1838d119f40de6460c459d93cef2d0f (patch)
tree413a6cb045fc8982b9d4f1257d167cdcc2468065
parent4b0b20189fbacf9acffc4c50797ab61c9f3f8f9f (diff)
downloadgstreamer-plugins-bad-27486729d1838d119f40de6460c459d93cef2d0f.tar.gz
vp8: fix codec state leaks
I only tested that vp8enc ! vp8dec does not crash, as valgrind does not grok at least one of the instructions used by vp8enc, preventing me from checking a leak, and the lack of one after the patch.
-rw-r--r--ext/vp8/gstvp8dec.c4
-rw-r--r--ext/vp8/gstvp8enc.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/ext/vp8/gstvp8dec.c b/ext/vp8/gstvp8dec.c
index 25538a813..cfdb3e198 100644
--- a/ext/vp8/gstvp8dec.c
+++ b/ext/vp8/gstvp8dec.c
@@ -306,6 +306,10 @@ gst_vp8_dec_reset (GstVideoDecoder * base_video_decoder, gboolean hard)
gst_video_codec_state_unref (decoder->output_state);
decoder->output_state = NULL;
}
+ if (hard && decoder->input_state) {
+ gst_video_codec_state_unref (decoder->input_state);
+ decoder->input_state = NULL;
+ }
if (decoder->decoder_inited)
vpx_codec_destroy (&decoder->decoder);
decoder->decoder_inited = FALSE;
diff --git a/ext/vp8/gstvp8enc.c b/ext/vp8/gstvp8enc.c
index fc3919e63..aa4d85ac8 100644
--- a/ext/vp8/gstvp8enc.c
+++ b/ext/vp8/gstvp8enc.c
@@ -467,6 +467,9 @@ gst_vp8_enc_finalize (GObject * object)
g_free (gst_vp8_enc->multipass_cache_file);
gst_vp8_enc->multipass_cache_file = NULL;
+ if (gst_vp8_enc->input_state)
+ gst_video_codec_state_unref (gst_vp8_enc->input_state);
+
G_OBJECT_CLASS (parent_class)->finalize (object);
}