mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
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.
This commit is contained in:
parent
4b0b20189f
commit
27486729d1
2 changed files with 7 additions and 0 deletions
|
@ -306,6 +306,10 @@ gst_vp8_dec_reset (GstVideoDecoder * base_video_decoder, gboolean hard)
|
||||||
gst_video_codec_state_unref (decoder->output_state);
|
gst_video_codec_state_unref (decoder->output_state);
|
||||||
decoder->output_state = NULL;
|
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)
|
if (decoder->decoder_inited)
|
||||||
vpx_codec_destroy (&decoder->decoder);
|
vpx_codec_destroy (&decoder->decoder);
|
||||||
decoder->decoder_inited = FALSE;
|
decoder->decoder_inited = FALSE;
|
||||||
|
|
|
@ -467,6 +467,9 @@ gst_vp8_enc_finalize (GObject * object)
|
||||||
g_free (gst_vp8_enc->multipass_cache_file);
|
g_free (gst_vp8_enc->multipass_cache_file);
|
||||||
gst_vp8_enc->multipass_cache_file = NULL;
|
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);
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue