aboutsummaryrefslogtreecommitdiffstats
path: root/src/cnetz/dsp.c
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2016-10-07 08:00:10 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2016-10-07 08:00:10 +0200
commiteac595bd173da32917046615132d1029ff01091b (patch)
tree78d0d60f9d8135fbf84470ed1009b433d83007dc /src/cnetz/dsp.c
parent0cec2f28be5e6890f60b333fd442f6cf72f69677 (diff)
C-Netz: Don't access transaction after destroying it
Diffstat (limited to 'src/cnetz/dsp.c')
-rw-r--r--src/cnetz/dsp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cnetz/dsp.c b/src/cnetz/dsp.c
index 170aede..d9c92ca 100644
--- a/src/cnetz/dsp.c
+++ b/src/cnetz/dsp.c
@@ -799,6 +799,13 @@ void unshrink_speech(cnetz_t *cnetz, int16_t *speech_buffer, int count)
int pos, i;
double x, y, x_last, y_last, factor;
+ /* check if we still have a transaction
+ * this might not be true, if we just released transaction, but still
+ * get a complete frame before we already switched back to OgK.
+ */
+ if (!cnetz->trans_list)
+ return;
+
/* fix offset between speech blocks by using high pass filter */
/* use first sample as previous sample, so we don't have a level jump between two subsequent audio chunks */
x_last = speech_buffer[0];