$OpenBSD: patch-src_qt_qtbase_src_plugins_platforms_xcb_qxcbscreen_cpp,v 1.1 2017/07/05 11:54:22 sthen Exp $

Index: src/qt/qtbase/src/plugins/platforms/xcb/qxcbscreen.cpp
--- src/qt/qtbase/src/plugins/platforms/xcb/qxcbscreen.cpp.orig
+++ src/qt/qtbase/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -544,7 +544,8 @@ void QXcbScreen::updateRefreshRate(xcb_randr_mode_t mo
         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;
             }
