Fixed real buffer deallocation, speech processor allocation blunder
authordttsp <dttsp>
Fri, 3 Jun 2005 19:41:57 +0000 (19:41 +0000)
committerdttsp <dttsp>
Fri, 3 Jun 2005 19:41:57 +0000 (19:41 +0000)
jDttSP/bufvec.c
jDttSP/speechproc.c

index 606992b0abc03178d9aad5faec1de4b80c9e3ad6..a027b4c3206f2caeebb57ebce8dda96c7f99cd3b 100644 (file)
@@ -127,7 +127,7 @@ newRLB(int size, REAL *base, char *tag) {
 void
 delRLB(RLB p) {
   if (p) {
-    delvec_REAL(RLBbase(p));
+    if (p->mine) delvec_REAL(RLBbase(p));
     free((char *) p);
   }
 }
index 2d3112601334b10a431e9f2c214a120378b8a3ad..90c0b009fcfc67dd534fdfb55f14baa517716e88 100644 (file)
@@ -37,7 +37,7 @@ Bridgewater, NJ 08807
 SpeechProc
 newSpeechProc(REAL K, REAL MaxCompression, COMPLEX *spdat, int size) {
   SpeechProc sp = (SpeechProc) safealloc(1, sizeof(speech_proc), "new speech processor");
-  sp->CG = newRLB(size, NULL, "CG buffer in Speech Processor");
+  sp->CG = newRLB(size + 1, NULL, "CG buffer in Speech Processor");
   sp->K = K;
   sp->MaxGain = pow(10.0, MaxCompression * 0.05);
   sp->LastCG = 1.0;