Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-71034

Null pointer dereference in QHighDpiScaling::updateHighDpiScaling if QGuiApplication::screens is empty

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P2: Important P2: Important
    • None
    • 5.9.6, 5.10.1, 5.11.2, 5.12.0 Beta 1
    • All

      If a QGuiApplication is started with no display connected or all connected displays turned off the eglfs qpa will not create any QScreen instances.

      init_platform in qguiapplication.cpp correctly guards its call to QHighDpiScaling::updateHighDpiScaling() but QGuiApplicationPrivate::eventDispatcherReady() calls it unconditionally.

      QHighDpiScaling::updateHighDpiScaling() calls QGuiApplication::primaryScreen() but doesn't account for the fact that it will return a null pointer if no QScreens have been created. The application will then crash when it tries to dereference the null pointer.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            sorvig Morten Sørvig
            asgeirb Asgeir Bjarni Ingvarsson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes