Skip to content

Fixed crash on move selection. 4.6#29525

Merged
DmitryArefiev merged 1 commit intomusescore:4.6.0from
igorkorsukov:fix/25814_4.6
Aug 28, 2025
Merged

Fixed crash on move selection. 4.6#29525
DmitryArefiev merged 1 commit intomusescore:4.6.0from
igorkorsukov:fix/25814_4.6

Conversation

@igorkorsukov
Copy link
Contributor

@igorkorsukov igorkorsukov commented Aug 27, 2025

Resolves: #25814

@igorkorsukov igorkorsukov force-pushed the fix/25814_4.6 branch 3 times, most recently from 88e59d1 to 26a34ed Compare August 28, 2025 09:04
@igorkorsukov igorkorsukov marked this pull request as ready for review August 28, 2025 09:05
currElem = isLeftDirection ? mb->prevElementStaff(si, currElem) : mb->nextElementStaff(si, currElem);
}

if (!currElem) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem was that currElem could become null, and we called the method (currElem->findAncestor(ElementType::VBOX)) on a null pointer in while

@mathesoncalum
Copy link
Contributor

Hmm, I already tried this in #26726 but apparently it didn't work (I could never repro locally)

@cbjeukendrup
Copy link
Member

@mathesoncalum It looks like you only had the check that Igor added as an IF_ASSERT_FAILED, and not yet the other check that Igor added

@igorkorsukov
Copy link
Contributor Author

Hmm, I already tried this in #26726 but apparently it didn't work (I could never repro locally)

    const auto nextNonVBox = [this, isLeftDirection](EngravingItem* currElem) -> EngravingItem* {
        if (!currElem) {
            return nullptr;
        }

The problem is not that it can be null when calling the function nextNonVBox, but that it can become null in the body of while. But while will stop only if const EngravingItem* vBox becomes null, there is no check that the currElem we call the method findAncestor can be null

@igorkorsukov igorkorsukov changed the title fixed crash on move selection Fixed crash on move selection. 4.6 Aug 28, 2025
@mathesoncalum
Copy link
Contributor

@cbjeukendrup @igorkorsukov Ahh yes - I misread. Thanks!

@DmitryArefiev
Copy link
Contributor

Tested #25814 on Win10, Mac13.7.2, LinuxUbuntu24.04.3 LTS - FIXED

@DmitryArefiev DmitryArefiev merged commit 63fcea2 into musescore:4.6.0 Aug 28, 2025
13 checks passed
@igorkorsukov igorkorsukov deleted the fix/25814_4.6 branch November 12, 2025 07:16
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.

4 participants