Fix speex segfault on init fail with bad data

This commit is contained in:
bnnm 2021-05-25 23:34:22 +02:00
parent 0e22f0b95c
commit 82518328ed

View File

@ -179,8 +179,10 @@ void free_speex(speex_codec_data* data) {
if (!data)
return;
if (data->state) {
speex_decoder_destroy(data->state);
speex_bits_destroy(&data->bits);
}
free(data->samples);
free(data);