Skip to content

demuxer fails when corrupted PES packet advertises incorrect length #35

@tmm1

Description

@tmm1

I have a sample that looks like this:

$ ./astits-probe packets -i id3.ts
2022/01/21 12:07:04 Fetching packets...
2022/01/21 12:07:04 PKT: 0
2022/01/21 12:07:04   Continuity Counter: 4
2022/01/21 12:07:04   Payload Unit Start Indicator: true
2022/01/21 12:07:04   Has Payload: true
2022/01/21 12:07:04   Has Adaptation Field: false
2022/01/21 12:07:04   Transport Error Indicator: false
2022/01/21 12:07:04   Transport Priority: false
2022/01/21 12:07:04   Transport Scrambling Control: 0
2022/01/21 12:07:04 PKT: 480
2022/01/21 12:07:04   Continuity Counter: 4
2022/01/21 12:07:04   Payload Unit Start Indicator: true
2022/01/21 12:07:04   Has Payload: true
2022/01/21 12:07:04   Has Adaptation Field: false
2022/01/21 12:07:04   Transport Error Indicator: false
2022/01/21 12:07:04   Transport Priority: false
2022/01/21 12:07:04   Transport Scrambling Control: 0
2022/01/21 12:07:04 PKT: 502
2022/01/21 12:07:04   Continuity Counter: 13
2022/01/21 12:07:04   Payload Unit Start Indicator: true
2022/01/21 12:07:04   Has Payload: true
2022/01/21 12:07:04   Has Adaptation Field: false
2022/01/21 12:07:04   Transport Error Indicator: false
2022/01/21 12:07:04   Transport Priority: false
2022/01/21 12:07:04   Transport Scrambling Control: 0
2022/01/21 12:07:04 PKT: 502
2022/01/21 12:07:04   Continuity Counter: 14
2022/01/21 12:07:04   Payload Unit Start Indicator: true
2022/01/21 12:07:04   Has Payload: true
2022/01/21 12:07:04   Has Adaptation Field: true
2022/01/21 12:07:04   Transport Error Indicator: false
2022/01/21 12:07:04   Transport Priority: false
2022/01/21 12:07:04   Transport Scrambling Control: 0
2022/01/21 12:07:04   Adaptation Field: &{AdaptationExtensionField:<nil> DiscontinuityIndicator:false ElementaryStreamPriorityIndicator:false HasAdaptationExtensionField:false HasOPCR:false HasPCR:false HasTransportPrivateData:false HasSplicingCountdown:false Length:80 IsOneByteStuffing:false StuffingLength:79 OPCR:<nil> PCR:<nil> RandomAccessIndicator:false SpliceCountdown:0 TransportPrivateDataLength:0 TransportPrivateData:[]}
2022/01/21 12:07:04 PKT: 502
2022/01/21 12:07:04   Continuity Counter: 15
2022/01/21 12:07:04   Payload Unit Start Indicator: false
2022/01/21 12:07:04   Has Payload: true
2022/01/21 12:07:04   Has Adaptation Field: true
2022/01/21 12:07:04   Transport Error Indicator: false
2022/01/21 12:07:04   Transport Priority: false
2022/01/21 12:07:04   Transport Scrambling Control: 0
2022/01/21 12:07:04   Adaptation Field: &{AdaptationExtensionField:<nil> DiscontinuityIndicator:false ElementaryStreamPriorityIndicator:false HasAdaptationExtensionField:false HasOPCR:false HasPCR:false HasTransportPrivateData:false HasSplicingCountdown:false Length:82 IsOneByteStuffing:false StuffingLength:81 OPCR:<nil> PCR:<nil> RandomAccessIndicator:false SpliceCountdown:0 TransportPrivateDataLength:0 TransportPrivateData:[]}

which fails to demux with this error:

$ ./astits-probe data -i id3.ts
2022/01/21 12:09:22 Fetching data...
2022/01/21 12:09:22 astits: fetching data failed: astits: getting next data failed: astits: building new data failed: astits: parsing PES data failed: astits: fetching next bytes failed: astikit: slice length is 184, offset 285 is invalid

http://0x0.st/oo1F.bin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions