]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't dereference NULL output pointer in wxTextMeasure.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 25 Nov 2012 23:17:10 +0000 (23:17 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 25 Nov 2012 23:17:10 +0000 (23:17 +0000)
Check that pointers are non-NULL before assigning 0 to them.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73016 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/textmeasure.cpp

index 7320111f0e51a33644d8dee6a829a469a107e0c4..48bec42aa5cd017c0441b5639bd87d4ca662482e 100644 (file)
@@ -116,8 +116,11 @@ void wxTextMeasure::DoGetTextExtent(const wxString& string,
 {
     if ( !m_context )
     {
-        *width =
-        *height = 0;
+        if ( width )
+            *width = 0;
+
+        if ( height )
+            *height = 0;
         return;
     }