Skip to content

Commit

Permalink
Fix GH#26593: Crash when importing MusicXML with multiple fermatas on…
Browse files Browse the repository at this point in the history
… a grace note
  • Loading branch information
Jojo-Schmitz committed Feb 22, 2025
1 parent add7ac9 commit a2077f2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/engraving/rendering/score/tlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2211,7 +2211,7 @@ void TLayout::layoutFermata(const Fermata* item, Fermata::LayoutData* ldata, con
double x = 0.0;
double y = 0.0;
const Segment* s = item->segment();
const EngravingItem* e = s->element(item->track());
const EngravingItem* e = s ? s->element(item->track()) : nullptr;

if (e) {
LD_CONDITION(e->ldata()->isSetBbox()); // e->shape()
Expand Down Expand Up @@ -2248,11 +2248,13 @@ void TLayout::layoutFermata(const Fermata* item, Fermata::LayoutData* ldata, con
ldata->setBbox(b.translated(-0.5 * b.width(), 0.0));

if (item->autoplace()) {
const Segment* s2 = item->segment();
const Measure* m = s2->measure();
LD_CONDITION(ldata->isSetPos());
LD_CONDITION(m->ldata()->isSetPos());
LD_CONDITION(s2->ldata()->isSetPos());
const Segment* s2 = item->segment();
if (s2) {
const Measure* m = s2->measure();
LD_CONDITION(m->ldata()->isSetPos());
LD_CONDITION(s2->ldata()->isSetPos());
}
}

Autoplace::autoplaceSegmentElement(item, ldata);
Expand Down

0 comments on commit a2077f2

Please sign in to comment.