From a11b8ded1dc86f04ef07265def0c0d5e95326b36 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 11 Dec 2015 16:44:14 +0300 Subject: [PATCH] winecfg: Fix a crash on empty size field in Desktop Integration. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- programs/winecfg/theme.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/programs/winecfg/theme.c b/programs/winecfg/theme.c index 52e64eb3600..8db457f9797 100644 --- a/programs/winecfg/theme.c +++ b/programs/winecfg/theme.c @@ -1214,8 +1214,17 @@ ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) int index = SendDlgItemMessageW(hDlg, IDC_SYSPARAM_COMBO, CB_GETCURSEL, 0, 0); index = SendDlgItemMessageW(hDlg, IDC_SYSPARAM_COMBO, CB_GETITEMDATA, index, 0); - metrics[index].size = atoi(text); - HeapFree(GetProcessHeap(), 0, text); + + if (text) + { + metrics[index].size = atoi(text); + HeapFree(GetProcessHeap(), 0, text); + } + else + { + /* for empty string set to minimum value */ + SendDlgItemMessageW(hDlg, IDC_SYSPARAM_SIZE_UD, UDM_GETRANGE32, (WPARAM)&metrics[index].size, 0); + } SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0); break;