qt: fix null pointer dereference in `CompositorX11UISurface`
During initialization, QVLCTools::restoreWindowPosition()
is called before the
window is shown (intentionally, as we don't want to resize after showing the
window). This is done before the content is set, which makes root item point to
a valid location.
Unlike what its name suggests, QVLCTools::restoreWindowPosition()
may adjust
the size of the window which in turn may cause a resize event be generated, and
this event may be sent immediately (synchronous) and not deferred until going
back to the event loop.
In this case updateSizes()
may be called, which is normally expected to be
called when everything is ready (i.e., root item, and its window are valid
pointers).
We can simply check if the root item pointer is null in updateSizes()
,
and not dereference it if it is a null pointer. This should be safe because
when the root item is set, its size is set anyway.
We don't need to check for m_uiWindow
, because it is set during construction.
Close #28880 (closed).
Request review @chub.
Merge request reports
Activity
mentioned in issue #28880 (closed)
changed milestone to %4.0
added Component::Interface: Qt label
requested review from @chub
added MRStatus::WaitingForReviewerFeedback label
mentioned in issue #29105
added MRStatus::Acceptable label and removed MRStatus::WaitingForReviewerFeedback label
added MRStatus::Accepted label and removed MRStatus::Acceptable label
MR Acceptance result
This MergeRequest has been Accepted! Congratulations.MR acceptance checks details:
-
MR should be considered mergeable by Gitlab -
Last pipeline should be successful -
MergeRequest should have at least one external review and/or vote -
All threads should be resolved, have votes and score > 0 -
MergeRequest should have no activity (threads/votes) for (72h/72h)
-
added 56 commits
-
cebb7fd9...95a8efe4 - 53 commits from branch
videolan:master
- 0cbba659 - qt: install event filter on render window at appropriate time in `CompositorX11UISurface`
- 703d8680 - qt: check if root item is null pointer in `CompositorX11UISurface::updateSizes()`
- f74194ff - qt: do not call `updateSizes()` and update root item size explicitly in...
Toggle commit list-
cebb7fd9...95a8efe4 - 53 commits from branch
enabled an automatic merge when all merge checks for f74194ff pass