From c1a801eaa516409d5064ae1ae76173cc09d249f7 Mon Sep 17 00:00:00 2001 From: "rafael@riseup.net" Date: Sun, 19 May 2013 17:14:32 +0000 Subject: [PATCH] possible fix for Opus crash on reconnect --- darkice/trunk/src/OpusLibEncoder.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/darkice/trunk/src/OpusLibEncoder.cpp b/darkice/trunk/src/OpusLibEncoder.cpp index 9a58bbf..65d4ccc 100644 --- a/darkice/trunk/src/OpusLibEncoder.cpp +++ b/darkice/trunk/src/OpusLibEncoder.cpp @@ -548,7 +548,13 @@ OpusLibEncoder :: close ( void ) throw ( Exception ) opusEncoder = NULL; encoderOpen = false; - delete[] internalBuffer; + if (internalBuffer) { + delete[] internalBuffer; + internalBuffer = NULL; + } + else { + fprintf(stderr, "Opus internalBuffer is NULL!\n"); + } getSink()->close(); }