Skip to content

Extensionless HTTP ISO URLs bypass disc recognition despite application/x-iso9660-image #860

Closed

Description

@qoli

Summary

Remote ISO/UDF disc images behind extensionless HTTP proxy URLs bypass the disc adapter even when the response declares Content-Type: application/x-iso9660-image. The raw image reaches libavformat and fails with AVERROR_INVALIDDATA (-1094995529).

Observed on tvOS in Syncnext 1.198 (557), using AetherEngine 7.45.0, commit 52802af. The default-branch Demuxer.openHTTP still has the same extension-only gate at the time of reporting.

Reproduction shape

  1. Serve a supported Blu-ray/DVD ISO through an HTTP byte-range proxy at an opaque path such as http://127.0.0.1:<port>/t4/play/<opaque-id>.
  2. Preserve the actual binary image, valid byte ranges, total length, and Content-Type: application/x-iso9660-image; the URL has no filename extension.
  3. Call engine.load(url: url, options: LoadOptions(...)) as a non-live URL source.
  4. Observe the ordinary AVIO reader being selected and demuxer open failing before container/stream analysis completes.

The production log shows:

admission: result=aether-default reason=confirmed-non-hls
sourceResolution=original nativeRemoteHLS=false isLive=false heldSourceConnection=true
MEDIA_REQUEST transport=avio-held-http1 range=bytes=0- response status=206
MEDIA_REQUEST finished bytes=1048576
MEDIA_REQUEST transport=avio-held-http1 range=bytes=0- response status=206
MEDIA_REQUEST finished bytes=1572864
HLSVideoEngine: open failed (Demuxer: open failed (Invalid data found when processing input (-1094995529)))

A separate post-failure diagnostic request to the same resource returned HTTP 206 and Content-Type: application/x-iso9660-image. These are sanitized excerpts; the original media, account information, and private proxy identifiers are omitted. This observation is from a downstream build with local integration patches, not a claimed pristine-upstream end-to-end fixture reproduction.

Source-level cause

Demuxer.isDiscImageURL accepts only URL extensions iso, img, and udf. openHTTP only constructs HTTPDiscIOReader / calls DiscReader.wrap when that predicate is true.

DiscReader already implements ISO9660/UDF structure recognition, but extensionless URL sources never reach it. The normal AVIOReader sends the entire disc filesystem to avformat_open_input as if it were an ordinary media container. The HTTP MIME declaration is not considered at this routing boundary.

Expected behavior

Treat the HTTP representation metadata as a disc-probe hint, including for URLs without an extension. Confirm any candidate with the existing ISO9660/UDF/BDMV/DVD structure readers before exposing a playable disc title. MIME alone is not proof of valid/playable disc contents.

Reuse the opening response or compatible prewarm information where possible; ordinary media should not incur a separate unconditional HEAD/range probe. Preserve existing authentication, redirects, range validation, cancellation, source identity, and live/sequential-origin semantics.

Regression coverage requested

  • Extensionless HTTP URL + ISO MIME + valid disc structure reaches the disc adapter.
  • MIME case/parameters are normalized.
  • Ordinary extensionless MP4/MKV keeps the normal streaming path.
  • A mislabelled non-disc response is not accepted as a playable disc.
  • Existing suffix-based ISO recognition and cancellation/range errors retain their behavior.

Activity

  1. superuser404notfound commented on Oct 25, 2026

    @superuser404notfound
    Owner

    Thanks for the precise report and the source-level analysis, both were spot on.

    Fixed on main in 5b8cc7c (fix d032cfa4), shipping with the next release:

    • AVIOReader keeps the Content-Type of the first 2xx answer the open already makes (or of an adopted prewarm, whose head response now carries it), so an extensionless URL costs no extra HEAD or range request.
    • A declared disc image type sends the open to the existing disc adapter. Recognized types: application/x-iso9660-image, application/x-cd-image, application/vnd.efi.iso, application/x-udf-image, application/x-raw-disk-image, with parameters, case and padding ignored.
    • The type is only a hint. DiscReader still decides from the ISO 9660 / UDF structure, and a mislabelled body reopens as ordinary media.
    • A URL that turned out to be a disc is remembered for the process, so the next open, a controlled probe (limits / cancellation) and updateRequestHeaders treat it like an .iso.
    • Suffix-based recognition, range validation, cancellation and the live path are unchanged; the reroute is VOD-only.

    Regression tests cover the cases listed in the issue: extensionless URL plus ISO type reaches the disc adapter (cold and prewarmed), type normalization, ordinary extensionless media keeps the streaming path, a mislabelled non-disc body is neither accepted as a disc nor remembered as one, and the controlled probe enables the disc probe from the response type.

    Leaving this open until it is confirmed against the Syncnext proxy on a release build.

  2. added a commit that references this issue on Oct 25, 2026
  3. superuser404notfound commented on Oct 26, 2026

    @superuser404notfound
    Owner

    Released in 7.48.0 (263dc11). Leaving this open for the retest.

  4. qoli commented on Oct 29, 2026

    @qoli
    ContributorAuthor

    7.52.0 follow-up: the declared-disc-MIME fix is present, but the extensionless application/octet-stream case still needs disc recognition.

    I checked release db35d50e5c3d5b617551ca27ec7ef4a3d4e534e3 (FFmpegBuild 3.11.0), which is also the current main head. We removed the downstream copies of the MIME/prewarm/known-disc-URL work you shipped in 7.48.0. Those are now owned by upstream.

    Remaining input shape

    • Fresh, opaque HTTP URL with no .iso, .img or .udf suffix.
    • Valid seekable byte-range response with Content-Type: application/octet-stream (also mixed case plus parameters).
    • Body is a valid playable ISO9660 DVD or UDF Blu-ray image.
    • Non-live load; both ordinary and held-source HTTP transports matter.

    The current DiscImageMediaType predicate deliberately excludes generic MIME, and its tests assert that exclusion. Demuxer.openHTTP consequently has neither a suffix/known-URL hint nor a declared-disc-type handoff for this fresh URL. It can hand the filesystem to the ordinary container probe without consulting the existing disc structure readers.

    This is a remaining input case, not a claim that your declared-MIME fix regressed. The unmodified-release gap here is established by the current routing code; the execution results below are explicitly from the downstream patched build.

    Downstream reproduction and narrow fix

    Our regression fixture serves a generated ISO9660 image at an opaque loopback URL, with the playable VOB placed at LBA 2048 (4 MiB). That placement prevents an accidental raw-container scan of a tiny fixture from looking like successful disc recognition. A successful open must set isDiscSource, expose a disc title, and discover its video stream. A generated UDF/BDMV fixture covers the same generic-MIME case.

    The remaining local patch checks the ISO9660/UDF volume-descriptor identifier at sector 16 through the same opening AVIO buffer, restores the read position before ordinary media probing, and sends candidates through the existing DiscReader validation. CD001 / BEA01 / NSR02 / NSR03 are hints, not proof of a playable disc. It does not classify every octet-stream body as a disc or add a separate unconditional HEAD / classification Range request.

    On the patched 7.52.0 build, regression cases pass for:

    • ISO9660 and UDF generic MIME, ordinary and held HTTP transports;
    • declared ISO MIME, parameters/case, prewarm, suffix recognition and seekable extraction;
    • ordinary extensionless media without an added HEAD or bytes=0-0 classification request;
    • mislabelled media and signature-only invalid discs;
    • cancellation at the source-open checkpoint before the subsequent disc probe;
    • unchanged declared-sequential-origin request behavior.

    A reporting-time rerun of the disc, bitmap-storage and off-main-subtitle suites passed all 18 Swift Testing tests (using the already-built patched test binary). This is synthetic demuxer coverage, not a claim of a fresh unmodified-release physical-device ISO playback test.

    Could this buffered-signature case be covered upstream as the continuation of #860? We still need the small generic-MIME portion of downstream patch 0008 until it is.

  5. superuser404notfound commented on Oct 30, 2026

    @superuser404notfound
    Owner

    Thanks for the follow-up and the fixture design, the 4 MiB VOB placement point is a good one.

    Covered on main in 7b74f35 (fix 73c93f5c), shipping with the next release:

    • Under application/octet-stream (parameters, case and padding ignored) the open reads the volume descriptor identifier at sector 16 (CD001, BEA01, NSR02, NSR03) from bytes it already holds: the warm head, the probe reader's first chunk, or the opening window of the persistent connection (waiting at most 2 s for it on the same connection). No HEAD, no bytes=0-0, no extra classification range.
    • A match reroutes to the existing disc adapter the same way a declared disc type does; DiscReader still decides, and a recognized URL is remembered for the process.
    • On this hint path a structure that does not parse (signature only, malformed descriptors) now falls back to ordinary media instead of failing the open. An .iso URL still reports it.
    • ProbeHTTPReader.discImageProbeEnabled turns on from the same verdict, so a controlled probe of an octet-stream ISO or UDF image runs the disc probe.
    • Other generic types (binary/octet-stream, a missing Content-Type) are not sniffed; say if your proxy sends one of those.

    Tests cover octet-stream ISO (cold and warmed) reaching the disc adapter, octet-stream UDF and ISO enabling the controlled probe's disc probe, ordinary octet-stream media keeping the streaming path, and a signature-only body that is neither accepted nor remembered as a disc and still plays.

    Leaving this open until it is confirmed against the Syncnext proxy on a release build, at which point downstream patch 0008 should be droppable.

  6. superuser404notfound commented on Oct 30, 2026

    @superuser404notfound
    Owner

    Released in 7.53.0 (4a82484).

  7. qoli commented on Nov 6, 2026

    @qoli
    ContributorAuthor

    Retested the original 22.54 GB Blu-ray ISO and the 43.92 GB ISO from our downstream follow-up through Syncnext’s normal T4 proxy on a physical Apple TV running tvOS 26.6.1. Both entries were resolved again from their original source and line.

    The signed Syncnext 1.212 (579) build uses the project’s Release configuration, AetherEngine 7.56.0 (76ad51a7), and FFmpegBuild 3.12.1. The app target uses its configured -Onone Release setting. Downstream disc patch 0008 has been retired.

    Source and previously observed Content-Type Physical-device result
    22.54 GB ISO, application/x-iso9660-image 11 disc-title chapters, 1920×1080 H.264, nativeAVPlayer. Landed at 600.000 s and continued playing through the 667.980 s observation.
    43.92 GB ISO, application/octet-stream 34 disc-title chapters, 1920×1080 H.264, avKitProxy. The engine and AVKit carrier both landed at 600.000 s, and playback continued through the 750.150 s observation.

    Both runs logged sourceResolution=original, heldSourceConnection=true, and an HTTP 206 response on avio-held-http1. I checked rendered video on the TV before and after each seek.

    Thanks for the fixes. Closing as completed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions