12 Commits
Author SHA1 Message Date
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
Damiano Galassi 027cb1f6ae Update copyright year. 2022-01-02 09:31:49 +01:00
Damiano Galassi 799fdcc642 Update copyright year. 2021-02-02 10:55:04 +01:00
Damiano Galassi b2394c7c3e Update copyright. 2020-09-22 11:38:15 +02:00
Damiano Galassi 0e421a6eef Enable and fixes more warnings. 2020-09-19 14:39:02 +02:00
Damiano Galassi 05d21d5f91 Remove \h from ssa. 2018-11-09 12:00:41 +01:00
Damiano Galassi ffb9a7bfc3 Cleanup. 2017-11-27 09:35:36 +01:00
Damiano Galassi 49d4448a30 Standardize .ass files new lines. 2017-11-27 09:34:44 +01:00
Damiano Galassi e4763788a3 Trim trailing '\0' 2017-10-03 14:11:14 +02:00
Damiano Galassi 8d8aaa0be6 Rename SBSubSerializer to MP42SubSerializer, remove some casts, fix SSA timestamp parsing. 2017-10-03 08:52:48 +02:00
Damiano Galassi 0908670715 Add a new SSA -> Text converter. 2017-10-02 19:10:14 +02:00
Damiano Galassi 826704ac9c Quite incomplete and untested ssa parser. 2017-10-02 12:45:35 +02:00