From 29e6114fe1a9dad15ff86088480bfd63725f9022 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 19 Oct 2013 12:37:54 -0700 Subject: [PATCH] Qt: Don't crash if audio feed is null. --- base/QtMain.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/base/QtMain.h b/base/QtMain.h index db7d4e078c..1f64470aef 100644 --- a/base/QtMain.h +++ b/base/QtMain.h @@ -198,11 +198,14 @@ public: output = new QAudioOutput(fmt); output->setBufferSize(mixlen); feed = output->start(); - timer = startTimer(1000*AUDIO_SAMPLES / AUDIO_FREQ); + if (feed != NULL) + timer = startTimer(1000*AUDIO_SAMPLES / AUDIO_FREQ); } ~MainAudio() { - killTimer(timer); - feed->close(); + if (feed != NULL) { + killTimer(timer); + feed->close(); + } output->stop(); delete output; free(mixbuf);