speex: Fix segfault when resetting the codecs multiple times
authorAnanda <ananda@latelier23.com>
Wed, 22 Oct 2014 13:28:44 +0000 (15:28 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 23 Oct 2014 08:30:26 +0000 (10:30 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=738793

ext/speex/gstspeexdec.c
ext/speex/gstspeexenc.c

index 9b62ebe..587255d 100644 (file)
@@ -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);
index fce0796..52b97ca 100644 (file)
@@ -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;