From b8b228a9dabca2740523f15f73c571b1e03efe20 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 1 Mar 2020 11:31:51 +1000 Subject: [PATCH] Fix a bug in WASAPI where an empty message could be logged. --- miniaudio.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/miniaudio.h b/miniaudio.h index ef0cf71a..137eefb5 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -11927,7 +11927,11 @@ done: pData->pAudioClient = NULL; } - return ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, errorMsg, result); + if (errorMsg != NULL && errorMsg[0] != '\0') { + ma_context_post_error(pContext, NULL, MA_LOG_LEVEL_ERROR, errorMsg, result); + } + + return result; } else { return MA_SUCCESS; }