Scott GarrettandClaude Code e42855867d Fix SSA header parsing for files without a [V4+ Styles] section
Three latent bugs combined into a crash or silently-empty subtitle
import (surfaced by feeding conv.ass to the Matroska subtitle-add
path):

- parseHeader: used NSScanner scanUpToString: for the section
  markers; a failed scanUpToString: returns YES and advances the
  scan location to the end of the string, so a file lacking
  "[V4+ Styles]" left the scanner exhausted and the [Events]
  Format: line was never parsed. Locate the markers with
  rangeOfString: instead.
- The Format line is split on commas but names are separated with
  ", " in the wild; the leading spaces made every field name fail
  its isEqualToString: in MP42SSALine, so no line ever got
  text/timestamps. Split on comma and trim whitespace.
- MP42SSALine's value loop looped to `count - 1` on an NSUInteger;
  with an empty format array that underflows and appends forever
  until the array traps. Guard count == 0.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-26 11:53:01 -05:00
2025-03-11 11:56:03 +01:00
2026-09-22 20:18:56 +02:00
2022-02-24 10:25:17 +01:00
2026-09-22 20:18:56 +02:00
2026-09-22 20:18:56 +02:00
2026-09-22 20:18:56 +02:00
2022-01-02 09:24:40 +01:00
2013-11-18 12:46:47 +01:00
2024-02-21 10:16:04 +01:00
S
Description
No description provided
24 MiB
0 Stars 1 Watchers 0 Forks
Languages
Objective-C 74%
C 10.5%
Objective-C++ 9.7%
Swift 5%
C++ 0.7%