summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYan Shapochnik <shapochniky@seapine.com>2012-04-11 19:02:49 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-04-13 02:23:46 (GMT)
commit19343812c691a6a35ce89e202770d67c3436825b (patch)
tree0cfde08771fc6fde480b33ed5eaa059ed362c42c
parent3b7edefb5b8a3dd6b1b53af4039cf1a862cd0aed (diff)
downloadQt-19343812c691a6a35ce89e202770d67c3436825b.zip
Qt-19343812c691a6a35ce89e202770d67c3436825b.tar.gz
Qt-19343812c691a6a35ce89e202770d67c3436825b.tar.bz2
Fix possible crash issue when testing the state of a QAccessibleMenuItem
The owner widget of a QAccessibleMenuItem may be NULL. Checking for a valid pointer before dereferncing. Change-Id: Ic3149ccc5d6ae0ebc83dae58163ae2f60397fd28 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
-rw-r--r--src/plugins/accessible/widgets/qaccessiblemenu.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/accessible/widgets/qaccessiblemenu.cpp b/src/plugins/accessible/widgets/qaccessiblemenu.cpp
index a795a6b..2ec3d26 100644
--- a/src/plugins/accessible/widgets/qaccessiblemenu.cpp
+++ b/src/plugins/accessible/widgets/qaccessiblemenu.cpp
@@ -623,7 +623,7 @@ QAccessible::State QAccessibleMenuItem::state(int child ) const
s = Normal;
QWidget *own = owner();
- if (own->testAttribute(Qt::WA_WState_Visible) == false || m_action->isVisible() == false) {
+ if (own && own->testAttribute(Qt::WA_WState_Visible) == false || m_action->isVisible() == false) {
s |= Invisible;
}
@@ -636,7 +636,7 @@ QAccessible::State QAccessibleMenuItem::state(int child ) const
s |= Focused;
#endif
}
- if (own->style()->styleHint(QStyle::SH_Menu_MouseTracking))
+ if (own && own->style()->styleHint(QStyle::SH_Menu_MouseTracking))
s |= HotTracked;
if (m_action->isSeparator() || !m_action->isEnabled())
s |= Unavailable;