[asterisk-commits] file: trunk r49716 - /trunk/codecs/codec_zap.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Jan 5 16:51:44 MST 2007


Author: file
Date: Fri Jan  5 17:51:43 2007
New Revision: 49716

URL: http://svn.digium.com/view/asterisk?view=rev&rev=49716
Log:
It is possible for framein to get called and no channel be available, so do a check before we increment the count.

Modified:
    trunk/codecs/codec_zap.c

Modified: trunk/codecs/codec_zap.c
URL: http://svn.digium.com/view/asterisk/trunk/codecs/codec_zap.c?view=diff&rev=49716&r1=49715&r2=49716
==============================================================================
--- trunk/codecs/codec_zap.c (original)
+++ trunk/codecs/codec_zap.c Fri Jan  5 17:51:43 2007
@@ -142,10 +142,18 @@
 	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);



More information about the asterisk-commits mailing list