summaryrefslogtreecommitdiff
path: root/pjmedia
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-11-19 20:28:34 +0000
committerBenny Prijono <bennylp@teluu.com>2006-11-19 20:28:34 +0000
commitb560429247dc4fa9cee950ee092308fb9a6b6f42 (patch)
treef897e2d5ef10325c884b9b75d3c2a9570307089a /pjmedia
parentc3b919f672c66cd0e7e4611555e92589b8c19e00 (diff)
Fixed memory leaks bug in speex codec
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@807 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia')
-rw-r--r--pjmedia/src/pjmedia-codec/speex/sb_celp.c2
-rw-r--r--pjmedia/src/pjmedia-codec/speex_codec.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/pjmedia/src/pjmedia-codec/speex/sb_celp.c b/pjmedia/src/pjmedia-codec/speex/sb_celp.c
index 465a538f..fe38891b 100644
--- a/pjmedia/src/pjmedia-codec/speex/sb_celp.c
+++ b/pjmedia/src/pjmedia-codec/speex/sb_celp.c
@@ -361,6 +361,7 @@ void sb_encoder_destroy(void *state)
speex_free(st->interp_lpc);
speex_free(st->interp_qlpc);
speex_free(st->pi_gain);
+ speex_free(st->low_innov);
speex_free(st->mem_sp);
speex_free(st->mem_sp2);
@@ -924,6 +925,7 @@ void sb_decoder_destroy(void *state)
speex_free(st->interp_qlpc);
speex_free(st->pi_gain);
speex_free(st->mem_sp);
+ speex_free(st->low_innov);
speex_free(state);
}
diff --git a/pjmedia/src/pjmedia-codec/speex_codec.c b/pjmedia/src/pjmedia-codec/speex_codec.c
index e4dda97a..8625e72b 100644
--- a/pjmedia/src/pjmedia-codec/speex_codec.c
+++ b/pjmedia/src/pjmedia-codec/speex_codec.c
@@ -310,12 +310,17 @@ PJ_DEF(pj_status_t) pjmedia_codec_speex_deinit(void)
return PJ_SUCCESS;
}
- /* We don't want to deinit if there's outstanding codec. */
pj_mutex_lock(spx_factory.mutex);
+
+ /* We don't want to deinit if there's outstanding codec. */
+ /* This is silly, as we'll always have codec in the list if
+ we ever allocate a codec! A better behavior maybe is to
+ deallocate all codecs in the list.
if (!pj_list_empty(&spx_factory.codec_list)) {
pj_mutex_unlock(spx_factory.mutex);
return PJ_EBUSY;
}
+ */
/* Get the codec manager. */
codec_mgr = pjmedia_endpt_get_codec_mgr(spx_factory.endpt);
@@ -742,9 +747,6 @@ static pj_status_t spx_codec_decode( pjmedia_codec *codec,
return PJ_SUCCESS;
}
- /* Initialization of the structure that holds the bits */
- speex_bits_init(&spx->dec_bits);
-
/* Copy the data into the bit-stream struct */
speex_bits_read_from(&spx->dec_bits, input->buf, input->size);