Unfortunately dynamic_cast can fail. When it does, it returns a null
From: Erik Hovland <erik@hovland.org>
pointer. So any pointer gotten from a dynamic_cast should be checked.
In mythmainwindow, the eventFilter member function does a
dynamic_cast of the event into a key event.
This patch makes sure we don't dereference that key event pointer if the
dynamic_cast didn't work.
---
libs/libmythui/mythmainwindow.cpp | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libs/libmythui/mythmainwindow.cpp b/libs/libmythui/mythmainwindow.cpp
index 8504cd5..a2b6942 100644
a
|
b
|
bool MythMainWindow::eventFilter(QObject *, QEvent *e) |
1171 | 1171 | case QEvent::KeyPress: |
1172 | 1172 | { |
1173 | 1173 | QKeyEvent *ke = dynamic_cast<QKeyEvent*>(e); |
| 1174 | if (!ke) |
| 1175 | return false; |
1174 | 1176 | |
1175 | 1177 | if (currentWidget()) |
1176 | 1178 | { |