From 401889f079da7619db7aa637fd8a25951bab625d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 23 Jul 2011 19:36:43 +0000 Subject: [PATCH] Don't try to pop from an empty stack in wxGDIPlusContext::PopState(). Using PopState() without a previous PushState() is an error but it shouldn't result in a crash, so add an assert guarding against it. Closes #13197. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68344 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/graphics.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index 3c8e85fe8a..c1c7df147c 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -1547,6 +1547,8 @@ void wxGDIPlusContext::PushState() void wxGDIPlusContext::PopState() { + wxCHECK_RET( !m_stateStack.empty(), wxT("No state to pop") ); + GraphicsState state = m_stateStack.top(); m_stateStack.pop(); m_context->Restore(state); -- 2.47.2