[TablEdit import] Stop decoding when a required read is short

Open
#35,848 2 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@lvinken is already working on this.

Since Dec 4, 2026.

Assessment

This issue has not been assessed yet.

Description

crash
Issue type

Crash or freeze

Description with steps to reproduce

Reported by coderabbitai when reviewing https://github.com/Jojo-Schmitz/MuseScore/pull/1386:

If the contents stream ends before its terminator, readUInt8() returns zero for each missing byte. The contents loop sees another offset of zero, appends a note, and repeats without advancing. Check the byte count and seek results. Return a format error before score construction when a required record is incomplete. A complete stream must still stop at its actual terminator.

Not fixing this may result in a crash or hangup when trying to import a truncated TablEdit file.

Supporting files, videos and screenshots

Not yet available, will attach later.

In which versions of MuseScore Studio is this issue present?

All versions with TablEdit import.

Regression

No.

Operating system

All

Additional context

Will fix this myself.

Checklist
  • This report follows the guidelines for reporting bugs and issues
  • I have verified that this issue has not been logged before, by searching the issue tracker for similar issues
  • I have attached all requested files and information to this report
  • I have attempted to identify the root problem as concisely as possible, and have used minimal reproducible examples where possible
Dominant language
C++
Stars
15.5k
Forks
3.5k
Avg merge
2d 19h
Merged PRs (30d)
124

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from musescore/MuseScore

All issues in musescore/MuseScore

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.