From: Vadim Zeitlin Date: Mon, 5 Oct 2009 22:56:27 +0000 (+0000) Subject: Don't use possibly uninitialized pen in wxMSWDCImpl. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1641cb376d295763dcc8bddfc01c8cca0e585332 Don't use possibly uninitialized pen in wxMSWDCImpl. Check that m_pen is valid before checking if it is transparent in DoDrawRoundedRectangle() too (this was already done in DoDrawRectangle() in r53150). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62288 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 15f83c4955..54b5e781fa 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -965,7 +965,7 @@ void wxMSWDCImpl::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wx // Windows draws the filled rectangles without outline (i.e. drawn with a // transparent pen) one pixel smaller in both directions and we want them // to have the same size regardless of which pen is used - adjust - if ( m_pen.GetStyle() == wxPENSTYLE_TRANSPARENT ) + if ( m_pen.IsOk() && m_pen.GetStyle() == wxPENSTYLE_TRANSPARENT ) { x2++; y2++;