diff options
author | Joshua Colp <jcolp@digium.com> | 2017-04-19 08:37:56 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-04-19 08:37:56 -0500 |
commit | 69bebd8f1a9a210108a9afe891a5b4b406be3029 (patch) | |
tree | d4efb64180ec0bee2811b98107b253903e622d60 /formats | |
parent | 441a75daea88d7d544889f06c449a26f83a27762 (diff) | |
parent | 90c630aaa1e33a6518b35a9b8361ff015e5ef3f5 (diff) |
Merge "format_ogg_vorbis: Clear ogg/vorbis data structures on close" into 13
Diffstat (limited to 'formats')
-rw-r--r-- | formats/format_ogg_vorbis.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/formats/format_ogg_vorbis.c b/formats/format_ogg_vorbis.c index 6428e275b..cf3b1c0e9 100644 --- a/formats/format_ogg_vorbis.c +++ b/formats/format_ogg_vorbis.c @@ -160,6 +160,7 @@ static int ogg_vorbis_rewrite(struct ast_filestream *s, if (vorbis_encode_init_vbr(&tmp->vi, 1, DEFAULT_SAMPLE_RATE, 0.4)) { ast_log(LOG_ERROR, "Unable to initialize Vorbis encoder!\n"); + vorbis_info_clear(&tmp->vi); return -1; } @@ -275,6 +276,13 @@ static void ogg_vorbis_close(struct ast_filestream *fs) * and write out the rest of the data */ vorbis_analysis_wrote(&s->vd, 0); write_stream(s, fs->f); + + /* Cleanup */ + ogg_stream_clear(&s->os); + vorbis_block_clear(&s->vb); + vorbis_dsp_clear(&s->vd); + vorbis_comment_clear(&s->vc); + vorbis_info_clear(&s->vi); } else { /* clear OggVorbis_File handle */ ov_clear(&s->ov_f); |