diff options
author | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | 2012-06-07 12:33:31 +0100 |
---|---|---|
committer | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | 2012-06-07 12:43:59 +0100 |
commit | 27486729d1838d119f40de6460c459d93cef2d0f (patch) | |
tree | 413a6cb045fc8982b9d4f1257d167cdcc2468065 | |
parent | 4b0b20189fbacf9acffc4c50797ab61c9f3f8f9f (diff) | |
download | gstreamer-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.c | 4 | ||||
-rw-r--r-- | ext/vp8/gstvp8enc.c | 3 |
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); } |