You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GpifParser._buildModel iterates _masterTrackAutomations and dereferences score.masterBars[barNumber] without checking that the index is in range:
constmasterBar: MasterBar=this.score.masterBars[barNumber];// masterBar can be undefined when barNumber >= masterBars.length
On real-world Guitar Pro 7/8 files where the score has been edited (e.g. bars removed) without removing the corresponding <MasterTrack> automations, or in files with off-by-one bar indices, this throws and the file fails to load entirely:
TypeError: Cannot read properties of undefined (reading 'tempoAutomations')
at GpifParser._buildModel (GpifParser.ts:2900)
at GpifParser.parseXml (GpifParser.ts:176)
at Gp7To8Importer.readScore (Gp7To8Importer.ts:75)
Expected Behavior
Guitar Pro desktop silently ignores orphan automations and renders the score normally. AlphaTab should match: skip the automation, continue parsing the rest of the score.
Steps To Reproduce
Obtain a Guitar Pro 8 file where a <MasterTrack><TempoAutomation> references Bar="N" for some N >= masterBars.length. Such files appear in the wild when bars are removed from the score after the automation was created.
Reference fixture: test-data/guitarpro8/orphan-tempo-automation.gp (a published GP8 file with 100 master bars and tempo automations targeting bars [0, 91-95, 97-100] — automation at bar 100 is one past the end). Fixture is committed in PR fix(importer): skip GPIF tempo automations on missing master bars #2668.
Run ScoreLoader.loadScoreFromBytes(bytes) (Node).
Observe TypeError thrown from GpifParser._buildModel.
Link to jsFiddle, CodePen, Project
No response
Version and Environment
alphaTab: 1.9.0 (commit f8ef24f, current HEAD of `develop`)
Node.js: v22.14.0
OS: Ubuntu 22.04.3 LTS on WSL2 (kernel 6.6.87.2-microsoft-standard-WSL2)
Is there an existing issue for this?
Current Behavior
GpifParser._buildModeliterates_masterTrackAutomationsand dereferencesscore.masterBars[barNumber]without checking that the index is in range:On real-world Guitar Pro 7/8 files where the score has been edited (e.g. bars removed) without removing the corresponding
<MasterTrack>automations, or in files with off-by-one bar indices, this throws and the file fails to load entirely:Expected Behavior
Guitar Pro desktop silently ignores orphan automations and renders the score normally. AlphaTab should match: skip the automation, continue parsing the rest of the score.
Steps To Reproduce
<MasterTrack><TempoAutomation>referencesBar="N"for someN >= masterBars.length. Such files appear in the wild when bars are removed from the score after the automation was created.test-data/guitarpro8/orphan-tempo-automation.gp(a published GP8 file with 100 master bars and tempo automations targeting bars[0, 91-95, 97-100]— automation at bar 100 is one past the end). Fixture is committed in PR fix(importer): skip GPIF tempo automations on missing master bars #2668.ScoreLoader.loadScoreFromBytes(bytes)(Node).TypeErrorthrown fromGpifParser._buildModel.Link to jsFiddle, CodePen, Project
No response
Version and Environment
alphaTab: 1.9.0 (commit f8ef24f, current HEAD of `develop`) Node.js: v22.14.0 OS: Ubuntu 22.04.3 LTS on WSL2 (kernel 6.6.87.2-microsoft-standard-WSL2)Platform
Web
Anything else?
No response