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

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

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        For Gerrit Dashboard: QTBUG-71034
        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes