aboutsummaryrefslogtreecommitdiffstats
path: root/codecs
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-05 23:51:43 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-05 23:51:43 +0000
commit60c952cca8959ad43a0fe4a89f407a11bb29f519 (patch)
tree2ebbfa8cb05033a80674374883211d457aa12c05 /codecs
parent914e1056d562b4ea02bccc1a16d5de836c6068ae (diff)
It is possible for framein to get called and no channel be available, so do a check before we increment the count.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@49716 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs')
-rw-r--r--codecs/codec_zap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/codecs/codec_zap.c b/codecs/codec_zap.c
index b07d3e586..8cd4862a5 100644
--- a/codecs/codec_zap.c
+++ b/codecs/codec_zap.c
@@ -142,10 +142,18 @@ static int zap_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
if(!ztp->inuse) {
ast_mutex_lock(&channelcount);
if(pvt->t->dstfmt == 8 || pvt->t->dstfmt == 0 ) {
+ if (complexinuse == totalchannels) {
+ ast_mutex_unlock(&channelcount);
+ return -1;
+ }
complexinuse++;
if(complexinuse == totalchannels)
deactivate_translator(0);
} else {
+ if (simpleinuse == totalchannels) {
+ ast_mutex_unlock(&channelcount);
+ return -1;
+ }
simpleinuse++;
if(simpleinuse == totalchannels)
deactivate_translator(1);