From 4d6eb30523bffef971595a444f64c9606657d7b6 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Thu, 17 Dec 2020 23:28:20 +0300 Subject: [PATCH] SDL_windowsmessagebox.c (AddDialogControl): add back NULL caption check. because AddDialogStaticIcon() sends a NULL caption -- fixes bug #5401. --- src/video/windows/SDL_windowsmessagebox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/windows/SDL_windowsmessagebox.c b/src/video/windows/SDL_windowsmessagebox.c index 8c6ed93ed..5bf464fa5 100644 --- a/src/video/windows/SDL_windowsmessagebox.c +++ b/src/video/windows/SDL_windowsmessagebox.c @@ -314,7 +314,7 @@ static SDL_bool AddDialogControl(WIN_DialogData *dialog, WORD type, DWORD style, if (!AddDialogData(dialog, &type, sizeof(type))) { return SDL_FALSE; } - if (type == DLGITEMTYPEBUTTON || (type == DLGITEMTYPESTATIC && caption[0])) { + if (type == DLGITEMTYPEBUTTON || (type == DLGITEMTYPESTATIC && caption != NULL && caption[0])) { if (!AddDialogString(dialog, caption)) { return SDL_FALSE; }