Skip to content

fix(preview): guard null Qt Quick scene graph nodes during startup and teardown - #187

Merged
sanskarIN merged 5 commits into
mainfrom
fix/preview-scenegraph-null-guards-20261107
Nov 7, 2026
Merged

sanskarIN merged 5 commits into
mainfrom
fix/preview-scenegraph-null-guards-20261107

Conversation

@sanskarIN

@sanskarIN sanskarIN commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Confirmed code-level vulnerability

Qt 6.8 documents that QQuickWindow::createRectangleNode() and createImageNode() return null when the scene graph has not initialized. FrameView::updatePaintNode() dereferenced these native pointers without checking, and also forwarded a potentially null texture to the image node. This could cause a native access violation during window initialization, recreation, or teardown.

Official Qt docs: https://doc.qt.io/qt-6.8/qquickwindow.html

Fix

  • If FrameView has no QQuickWindow, return the existing node without accessing the window.
  • Check rectangle and image node factory returns before using them.
  • Do not append a newly created image node until a non-null texture exists.
  • If a replacement texture cannot be created, keep the previous valid image and retry on a later update.
  • Add a regression for a detached FrameView and the attach-then-detach lifecycle. Qt's scene graph may already be initialized by a newly constructed QQuickWindow under the software backend, so the test does not presume initialization timing.
  • Run the new GUI test on Linux and Windows with the offscreen software Qt Quick backend.

Relationship to crash investigation

Tracked separately from Windows ARM startup issue #185 and user export issue #175. This prevents specific null dereferences, but is not proof that they caused either observed 0xC0000005 event.

Gates

  • Formatting, Windows/Linux GUI compilation and regression.
  • Linux sanitizer and GCC/static-analysis checks.
  • Windows packaged verification, including ARM.

No stable release, no change to export FPS, and no claim of completed native crash root cause.

@sanskarIN
sanskarIN marked this pull request as ready for review November 7, 2026 14:20
@sanskarIN
sanskarIN merged commit 3a550c5 into main Nov 7, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant