From 0cf0dfae6b6874a8e783fea386ef01b087ddfed2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 18 Dec 2013 16:18:57 +0000 Subject: [PATCH] Don't crash in wxAuiToolBar::GetToolBarFits(). The code could crash if m_overflowVisible was true but m_overflowSizerItem was NULL. Ideally this shouldn't happen in the first place, but it did, so at least fix the crash for now -- and hopefully this code will be refactored to make it more clear later. Closes #15747. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75400 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/auibar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index f2af2eb1f1..4170d8d960 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -1772,7 +1772,7 @@ bool wxAuiToolBar::GetToolFitsByIndex(int tool_idx) const if (m_orientation == wxVERTICAL) { // take the dropdown size into account - if (m_overflowVisible) + if (m_overflowVisible && m_overflowSizerItem) cli_h -= m_overflowSizerItem->GetSize().y; if (rect.y+rect.height < cli_h) @@ -1781,7 +1781,7 @@ bool wxAuiToolBar::GetToolFitsByIndex(int tool_idx) const else { // take the dropdown size into account - if (m_overflowVisible) + if (m_overflowVisible && m_overflowSizerItem) cli_w -= m_overflowSizerItem->GetSize().x; if (rect.x+rect.width < cli_w)