aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2018-12-16 14:18:59 +0100
committerStapleButter <thetotalworm@gmail.com>2018-12-16 14:18:59 +0100
commita99ebf38db2dbdd76e3347441a5aa5a3de05b873 (patch)
treee9423e3e593400ec91350b5b211f53b12d9d01d3
parent3f26fbddc028260f6cd824693816d0a6a3e9081a (diff)
prevent crash if mic init fails
-rw-r--r--src/libui_sdl/main.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp
index 6cdfe7a..84bbb94 100644
--- a/src/libui_sdl/main.cpp
+++ b/src/libui_sdl/main.cpp
@@ -318,6 +318,7 @@ void FeedMicInput()
{
int type = Config::MicInputType;
if ((type != 1 && MicCommand == 0) ||
+ (type == 1 && MicBufferLength == 0) ||
(type == 3 && MicWavBuffer == NULL))
{
type = 0;