mltframework / mltframework/shotcut

Crash (access violation) when Add Subtitle is repeated after "Not enough space to add subtitle"

Open
#1,912 1 comment 0 reactions 0 assignees View on GitHub

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:

  1. Start Shotcut and append a clip to the timeline
  2. Move the playhead to within 500 ms of the end of the project
  3. In the Subtitles panel, use Add Subtitle — the status bar shows "Not enough space to add subtitle."
  4. Invoke Add Subtitle again, two more times
  5. 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.

  1. SubtitlesDock::onAddRequested() (src/docks/subtitlesdock.cpp:773) calls ensureTrackExists() 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.

  2. SubtitlesModel::doRemoveTrack() (src/models/subtitlesmodel.cpp:592) detects an out-of-range index but only logs it — there is no return, 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

Open the contributing guide

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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.