From 0d35cdb7e67aa8d030cd5e449e6b518ff60ec721 Mon Sep 17 00:00:00 2001
From: dttsp <dttsp>
Date: Fri, 3 Jun 2005 19:41:57 +0000
Subject: [PATCH] Fixed real buffer deallocation, speech processor allocation
 blunder

---
 jDttSP/bufvec.c     | 2 +-
 jDttSP/speechproc.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/jDttSP/bufvec.c b/jDttSP/bufvec.c
index 606992b..a027b4c 100644
--- a/jDttSP/bufvec.c
+++ b/jDttSP/bufvec.c
@@ -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);
   }
 }
diff --git a/jDttSP/speechproc.c b/jDttSP/speechproc.c
index 2d31126..90c0b00 100644
--- a/jDttSP/speechproc.c
+++ b/jDttSP/speechproc.c
@@ -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;
-- 
2.45.2