summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbscreen.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-11-27 13:00:01 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2015-11-27 17:43:53 +0000
commit69817f6ad13e94ed51b15488b18bafe9b7f44c26 (patch)
treeb2ac7843ac557dc071560518fc9c705901c3fbb4 /src/plugins/platforms/xcb/qxcbscreen.cpp
parentd6ecdb434410ffda64058cdb51483786f5af9932 (diff)
parentea5f40a7880946dd5e3346235d1a8e1a1a8fd42e (diff)
Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbscreen.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index 55bae05523..db7d837e01 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -556,7 +556,8 @@ void QXcbScreen::updateRefreshRate(xcb_randr_mode_t mode)
for (; modesIter.rem; xcb_randr_mode_info_next(&modesIter)) {
xcb_randr_mode_info_t *modeInfo = modesIter.data;
if (modeInfo->id == mode) {
- m_refreshRate = modeInfo->dot_clock / (modeInfo->htotal * modeInfo->vtotal);
+ const uint32_t dotCount = modeInfo->htotal * modeInfo->vtotal;
+ m_refreshRate = (dotCount != 0) ? modeInfo->dot_clock / dotCount : 0;
m_mode = mode;
break;
}