Commit f5e2fff
committed
fix(importer): skip GPIF tempo automations on missing master bars
GpifParser._buildModel iterated _masterTrackAutomations and dereferenced
score.masterBars[barNumber] without checking that the index was within
range. Real-world GP7/8 files (off-by-one indexing, scores edited to
fewer bars) reference bar numbers past the masterBars list, producing:
TypeError: Cannot read properties of undefined (reading 'tempoAutomations')
Skip the automation if the master bar is absent. The fixture
test-data/guitarpro8/orphan-tempo-automation.gp has 100 master bars and
a tempo automation targeting bar 100 (off-by-one) that previously
crashed the importer.1 parent f8ef24f commit f5e2fff
3 files changed
Lines changed: 15 additions & 1 deletion
File tree
- packages/alphatab
- src/importer
- test-data/guitarpro8
- test/importer
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2892 | 2892 | | |
2893 | 2893 | | |
2894 | 2894 | | |
2895 | | - | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
2896 | 2900 | | |
2897 | 2901 | | |
2898 | 2902 | | |
| |||
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
513 | 523 | | |
0 commit comments