aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-02 17:56:37 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-02 17:56:37 +0000
commit7487925f29c2c6b126749d7887a4c4f06c215370 (patch)
tree1b417b44181d870150cbc5c70a9169d2a53c260c
parent67638ecf82e49f68a1c90c10170ec60f714907ef (diff)
This patch hopefully solves 10141; The user is running with it, and it doesn't appear to harm asterisk's operation, and may prevent a crash. I'll store it in 1.2, as we have shut down support on 1.2, but since I developed the patch before support finished, and it might affect 1.4 and trunk, I'm going ahead with it.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@77942 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--fskmodem.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fskmodem.c b/fskmodem.c
index 18e845c1e..2b4dc0bb5 100644
--- a/fskmodem.c
+++ b/fskmodem.c
@@ -185,6 +185,9 @@ int fsk_serie(fsk_data *fskd, short *buffer, int *len, int *outbyte)
int i,j,n1,r;
int samples=0;
int olen;
+ int beginlen=*len;
+ int beginlenx;
+
switch(fskd->state) {
/* Pick up where we left off */
case STATE_SEARCH_STARTBIT2:
@@ -212,12 +215,13 @@ of a transmission (what a LOSING design), we cant do it this elegantly */
beginning of a start bit in the TDD sceanario. It just looks for sufficient
level to maybe, perhaps, guess, maybe that its maybe the beginning of
a start bit, perhaps. This whole thing stinks! */
+ beginlenx=beginlen; /* just to avoid unused war warnings */
if (demodulador(fskd,&fskd->x1,GET_SAMPLE)) return(-1);
samples++;
for(;;)
{
search_startbit2:
- if (!*len) {
+ if (*len <= 0) {
fskd->state = STATE_SEARCH_STARTBIT2;
return 0;
}
@@ -235,7 +239,7 @@ search_startbit3:
fskd->state = STATE_SEARCH_STARTBIT3;
return 0;
}
- for(;i;i--) { if (demodulador(fskd,&fskd->x1,GET_SAMPLE)) return(-1);
+ for(;i>0;i--) { if (demodulador(fskd,&fskd->x1,GET_SAMPLE)) return(-1);
#if 0
printf("x1 = %5.5f ", fskd->x1);
#endif