Skip to content

Fix RTP timestamp parsing#119

Open
sergeyptv wants to merge 1 commit into
deepch:masterfrom
sergeyptv:fix/rtp-timestamp-parsing
Open

Fix RTP timestamp parsing#119
sergeyptv wants to merge 1 commit into
deepch:masterfrom
sergeyptv:fix/rtp-timestamp-parsing

Conversation

@sergeyptv
Copy link
Copy Markdown

Correctly read 4-byte timestamp from RTP header (positions 8-11) instead of erroneous 8-byte read. Ensures RFC 3550 compliance.

Cacsjep added a commit to Cacsjep/vdk that referenced this pull request May 27, 2026
Add several robustness fixes to the RTSP demuxer and client and introduce unit tests.

- Add mergeResponseHeader to preserve Digest over Basic in WWW-Authenticate responses (prefer strongest scheme) to avoid downgrading to Basic (backports upstream PR deepch#104) and use it when parsing response headers.
- Use RFC 7826 default ports: 322 for rtsps and 554 for rtsp (backports upstream PR deepch#118) when parsing URLs; normalize unknown schemes to rtsp. Add URL parsing tests.
- Fix RTP timestamp slice to read exactly 4 bytes (avoid leaking SSRC into timestamp) (backports upstream PR deepch#119) and add tests verifying timestamp behavior.
- Harden H.264 STAP-A parsing to guard against size==0 causing OOB reads (prevents panics, referenced upstream issue deepch#114).
- Add bounds checks in AAC handling to avoid panics from malformed AU headers and frame sizes (backports upstream PR deepch#126).
- Add comprehensive tests: client_test.go and demuxer_test.go covering URL parsing, WWW-Authenticate merging, H.264 STAP-A, AAC malformed packets, metadata reassembly, and other demuxer behaviors. Remove older demuxer_metadata_test.go in favor of unified tests.
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.

1 participant