mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
speex: Fix crash on Windows caused by cross-CRT issue
Use speex_header_free() to free memory which was allocated by library. Cross-CRT issue should not happen on 1.17 Cerbero build but might happen custom build or so. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/606>
This commit is contained in:
parent
b94b9988fa
commit
1b8df15b78
2 changed files with 3 additions and 2 deletions
|
@ -132,7 +132,7 @@ gst_speex_dec_reset (GstSpeexDec * dec)
|
|||
dec->frame_size = 0;
|
||||
dec->frame_duration = 0;
|
||||
dec->mode = NULL;
|
||||
free (dec->header);
|
||||
speex_header_free (dec->header);
|
||||
dec->header = NULL;
|
||||
speex_bits_destroy (&dec->bits);
|
||||
speex_bits_set_bit_buffer (&dec->bits, NULL, 0);
|
||||
|
|
|
@ -718,7 +718,8 @@ gst_speex_enc_handle_frame (GstAudioEncoder * benc, GstBuffer * buf)
|
|||
|
||||
/* create header buffer */
|
||||
data = (guint8 *) speex_header_to_packet (&enc->header, &data_len);
|
||||
buf1 = gst_buffer_new_wrapped (data, data_len);
|
||||
buf1 = gst_buffer_new_wrapped_full (0,
|
||||
data, data_len, 0, data_len, data, (GDestroyNotify) speex_header_free);
|
||||
GST_BUFFER_OFFSET_END (buf1) = 0;
|
||||
GST_BUFFER_OFFSET (buf1) = 0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue