From fdf85116102ed03a56dae3947f4251bf0f889f33 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 10 Mar 2010 13:37:36 +0100 Subject: Do qFatal() on unsupported screen format instead of crashing later MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: Related to QTBUG-5117 Reviewed-by: Jørgen Lind --- src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp index e78fec1..f5ad70c 100644 --- a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp +++ b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp @@ -2163,6 +2163,9 @@ bool QVNCScreen::connect(const QString &displaySpec) if (QScreenDriverFactory::keys().contains(driver, Qt::CaseInsensitive)) { const int id = getDisplayId(dspec); QScreen *s = qt_get_screen(id, dspec.toLatin1().constData()); + if (s->pixelFormat() == QImage::Format_Indexed8 + || s->pixelFormat() == QImage::Format_Invalid && s->depth() == 8) + qFatal("QVNCScreen: unsupported screen format"); setScreen(s); } else { // create virtual screen #if Q_BYTE_ORDER == Q_BIG_ENDIAN -- cgit v0.12