mltframework / mltframework/shotcut
Crash (access violation) when Add Subtitle is repeated after "Not enough space to add subtitle"
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 11h 27m
- Merged PRs (30d)
- 5
Description
OS and Version (please complete the following information):
- Operating System: Windows 11 Pro (build 26200)
- Shotcut Version: 26.8.1 (official Windows x64 installer)
Describe the bug
Shotcut terminates with an unhandled access violation, with no error dialog, after the Add Subtitle action is invoked repeatedly while the status bar reports "Not enough space to add subtitle."
Windows Error Reporting logged two crashes with an identical signature:
Faulting application: shotcut.exe, version 26.8.1.0, timestamp 0x6a6dc118
Faulting module: shotcut.exe, version 26.8.1.0, timestamp 0x6a6dc118
Exception code: 0xc0000005 (access violation)
Fault offset: 0x000000000028d0d3
Both crashes landed in the same WER bucket, so it appears deterministic rather than a race.
Observed sequence (from shotcut-log.txt)
[Debug] <SubtitlesDock::onAddRequested>
[Debug] <Subtitles::InsertTrackCommand::redo> "Subtitle Track 1"
[Info ] <MainWindow::showStatusMessage> "Not enough space to add subtitle."
[Debug] <SubtitlesModel::doRemoveTrack> 0
[Debug] <SubtitlesDock::onAddRequested>
[Debug] <Subtitles::InsertTrackCommand::redo> "Subtitle Track 1"
[Info ] <MainWindow::showStatusMessage> "Not enough space to add subtitle."
[Debug] <TimelineDock::setSelection> Changing selection to QList() trackIndex -1 isMultitrack true
[Debug] <SubtitlesDock::onAddRequested>
[Debug] <Application::~Application> exiting
The UI language was pt-BR; the two status messages are translated back to English here. Note that the third onAddRequested emits no further output before the process dies.
Steps To Reproduce
These are reconstructed from the log rather than from a minimized test case, so the exact number of repetitions may vary:
- Start Shotcut and append a clip to the timeline
- Move the playhead to within 500 ms of the end of the project
- In the Subtitles panel, use Add Subtitle — the status bar shows "Not enough space to add subtitle."
- Invoke Add Subtitle again, two more times
- Shotcut exits silently
Expected behavior
The rejected action should be a no-op beyond the status message, and repeating it should remain a no-op.
Possible causes
Offered as leads from reading the source only — I have not attached a debugger to confirm either one.
-
SubtitlesDock::onAddRequested()(src/docks/subtitlesdock.cpp:773) callsensureTrackExists()before validating the available space, then returns early on the "not enough space" path. Every rejected attempt therefore leaves a newly created subtitle track behind. -
SubtitlesModel::doRemoveTrack()(src/models/subtitlesmodel.cpp:592) detects an out-of-range index but only logs it — there is noreturn, so execution falls through into the removal with the invalid index:
if (trackIndex < 0 || trackIndex >= m_tracks.size()) {
LOG_ERROR() << "Invalid index" << trackIndex;
}
beginRemoveRows(QModelIndex(), trackIndex, trackIndex);
m_tracks.remove(trackIndex);
m_items.remove(trackIndex);
The WER minidump is available if it would help.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/docks/subtitlesdock.cpp at SubtitlesDock::onAddRequested() and src/models/subtitlesmodel.cpp at SubtitlesModel::doRemoveTrack(), following the repeated failed Add Subtitle sequence. Reproduce near the project end, then verify rejected additions remain safe to repeat and no invalid track removal occurs; use the supplied log and WER signature to confirm the crash is gone.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100