From ec3af50cc26be86e36368f328d5ef489a3bc1dc9 Mon Sep 17 00:00:00 2001 From: Ananda Date: Wed, 22 Oct 2014 15:28:44 +0200 Subject: [PATCH] speex: Fix segfault when resetting the codecs multiple times https://bugzilla.gnome.org/show_bug.cgi?id=738793 --- ext/speex/gstspeexdec.c | 1 + ext/speex/gstspeexenc.c | 1 + 2 files changed, 2 insertions(+) diff --git a/ext/speex/gstspeexdec.c b/ext/speex/gstspeexdec.c index 9b62ebe72a..587255d7ba 100644 --- a/ext/speex/gstspeexdec.c +++ b/ext/speex/gstspeexdec.c @@ -136,6 +136,7 @@ gst_speex_dec_reset (GstSpeexDec * dec) free (dec->header); dec->header = NULL; speex_bits_destroy (&dec->bits); + speex_bits_set_bit_buffer (&dec->bits, NULL, 0); gst_buffer_replace (&dec->streamheader, NULL); gst_buffer_replace (&dec->vorbiscomment, NULL); diff --git a/ext/speex/gstspeexenc.c b/ext/speex/gstspeexenc.c index fce07962a1..52b97ca159 100644 --- a/ext/speex/gstspeexenc.c +++ b/ext/speex/gstspeexenc.c @@ -269,6 +269,7 @@ gst_speex_enc_stop (GstAudioEncoder * benc) enc->state = NULL; } speex_bits_destroy (&enc->bits); + speex_bits_set_bit_buffer (&enc->bits, NULL, 0); gst_tag_list_unref (enc->tags); enc->tags = NULL;