Skip to content

Commit

Permalink
Fix crash on empty track data for MKV
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <[email protected]>
  • Loading branch information
ecdye committed Oct 24, 2024
1 parent bd28693 commit 0bf61d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/macSubtitleOCR/MKV/MKVTrackParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ class MKVTrackParser: MKVFileHandler {

let trackData = extractTrackData(for: subtitleTracks)
trackData?.enumerated().forEach { index, data in
if data.isEmpty {
print("Found empty track data for track \(index + 1), skipping track!")
return
}
tracks.append(MKVTrack(
trackNumber: index,
codecID: subtitleTracks[index + 1]!,
Expand Down

0 comments on commit 0bf61d6

Please sign in to comment.