Skip to content

fix(oot): open voice streams whose path has a double slash - #2035

Merged
ly05010419 merged 1 commit into
ly05010419:mainfrom
Kolkka:fix/oot-voice-double-slash
Nov 10, 2026
Merged

ly05010419 merged 1 commit into
ly05010419:mainfrom
Kolkka:fix/oot-voice-double-slash

Conversation

@Kolkka

@Kolkka Kolkka commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Ocarina of Time asks for its voice lines as content://Voice/Resource//Stream/.... romfs_path_relative rejects the empty component between Resource and Stream, so every voice stream open returns not-found. Music and effects use a single slash and are unaffected.

  • games/oot/runtime/romfs_path.h: new romfs_path_relative_collapsed collapses repeated separators and then applies the same validation. . and .. are still rejected, including right after a double slash, and romfs_path_relative itself stays strict.
  • romfs.c and aoc_romfs.c: RomFS and add-on content requests go through the new function.
  • probe-fs: the Resource//Stream case, plus a traversal behind a double slash that must still fail.
  • tests/test_oot_romfs_paths.{c,py}: 18 parser cases, no game files needed (same pattern as the Dread path test).

Tested: the new test plus the existing TotK and Dread path tests pass. romfs.c and aoc_romfs.c compile with the OoT Makefile's -Wall -Wextra -Werror. Not yet run in game on this port. The Resource//Stream requests were seen on game version 1.0.0.

Found and first fixed by @MD5Visual in the games/totk-based port (Kolkka#4), where the voice lines were confirmed playing in the Goron cutscene.

Ocarina of Time asks for its voice lines as content://Voice/Resource//Stream/... . The RomFS parser rejects the empty component between "Resource" and "Stream", so every voice stream open returned not-found. Music and effects use a single slash and were unaffected.

romfs_path_relative_collapsed collapses repeated separators and then applies the same strict validation, so "." and ".." are still rejected. RomFS and add-on content requests both use it, and romfs_path_relative stays strict. probe-fs gains the Resource//Stream case and a traversal case behind a double slash. tests/test_oot_romfs_paths covers the parser without game files.

Found and first fixed by MD5Visual in the games/totk-based port (#4).

Co-Authored-By: MD5Visual <134655923+MD5Visual@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017tiHucPmA6R8Fqbf1Y85ny
ly05010419 added a commit that referenced this pull request Nov 10, 2026
…e asks for it (after PR #2035)

The probe opened TotK's Sound/Resource/Stream/Dm_OP_0001.bwav, which OoT's RomFS does not have (0 in its index), so
probe-fs failed at its first check since the port began. It now takes the first Voice/Resource/Stream/ file of the
sorted index, reads it under its own name, and compares the bytes under Voice/Resource//Stream/ and rom://; '..' after
either double slash must still fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ly05010419
ly05010419 merged commit 68760b2 into ly05010419:main Nov 10, 2026
4 checks passed
@ly05010419

Copy link
Copy Markdown
Owner

Merged in 68760b2 and pushed — thank you, and for crediting the original find. One follow-up after it (6bc0ec8): probe-fs still opened TotK's Sound/Resource/Stream/Dm_OP_0001.bwav, which OoT's RomFS does not have, so the probe failed at its first check. It now takes the first Voice/Resource/Stream/ file of the sorted index and compares its bytes under Voice/Resource//Stream/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants