Skip to content

index out of bounds while parsing some ts file #2

@lu-zero

Description

@lu-zero

I started to look at your implementation and sadly it seems to hate the ts samples I'm trying it with:

❯ RUST_BACKTRACE=1 cargo run --example pcr_measure ~/Samples/mpegts/solidaria-spts.ts
    Finished dev [unoptimized + debuginfo] target(s) in 0.02s
     Running `target/debug/examples/pcr_measure /Users/lu_zero/Samples/mpegts/solidaria-spts.ts`
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', src/parser/payload.rs:86:40
stack backtrace:
   0: rust_begin_unwind
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:142:14
   2: core::panicking::panic_bounds_check
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:84:5
   3: mpegts::parser::payload::parse_program_map
             at ./src/parser/payload.rs:86:40
   4: mpegts::parser::payload::parse_payload
             at ./src/parser/payload.rs:342:22
   5: mpegts::parser::packet::parse_some_packets
             at ./src/parser/packet.rs:63:24
   6: mpegts::parser::packet::parse_next_packets
             at ./src/parser/packet.rs:18:10
   7: pcr_measure::main
             at ./examples/pcr_measure.rs:34:19
   8: core::ops::function::FnOnce::call_once
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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