Skip to content

Reject demux packets with a negative length - #12

Closed
user-none wants to merge 1 commit into
gen2brain:mainfrom
user-none:fix-demux-packet-length
Closed

user-none wants to merge 1 commit into
gen2brain:mainfrom
user-none:fix-demux-packet-length

Conversation

@user-none

Copy link
Copy Markdown
Contributor

A packet whose length field is smaller than the header fields after it (stuffing, P-STD, PTS/DTS) ends up with a negative payload length. packet() then slices with an end before the start and panics. Packets with a negative length are now dropped as invalid.

@gen2brain

Copy link
Copy Markdown
Owner

Thanks, reproduced. Landed as 4c78faa with the check where the length is computed, plus a test.

@gen2brain gen2brain closed this Nov 11, 2026
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