avformat/rtpenc_vc2hq: Write the extended sequence number

RFC 8450 requires the high order 16 bits of the 32 bit packet sequence
number in the payload header, 0 was always written. Count the wraps of
the RTP sequence number in the RTP muxer.

Not a security issue.

Found during triage of the security report HRhmcrDPRPyf
This commit is contained in:
Michael Niedermayer authored and michaelni committed 2026-10-11 01:31:37 +00:00
1 parent bceb10aa04
commit 5c25cb3453
3 files changed
+4 -1

No files matched your search

+2
View File
@@ -384,6 +384,8 @@ void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m)
avio_flush(s1->pb);
s->seq = (s->seq + 1) & 0xffff;
if (!s->seq)
s->seq_high++;
s->octet_count += len;
s->packet_count++;
}
+1
View File
@@ -32,6 +32,7 @@ struct RTPMuxContext {
uint32_t ssrc;
const char *cname;
int seq;
uint16_t seq_high;
uint32_t timestamp;
uint32_t base_timestamp;
uint32_t cur_timestamp;
+1 -1
View File
@@ -43,7 +43,7 @@ static int send_packet(AVFormatContext *ctx, uint8_t parse_code, int info_hdr_si
return AVERROR_INVALIDDATA;
}
AV_WB16(&rtp_ctx->buf[0], 0); /* extended sequence number */
AV_WB16(&rtp_ctx->buf[0], rtp_ctx->seq_high); /* extended sequence number */
AV_WB8 (&rtp_ctx->buf[2], i ? (f ? (0x03) : (0x02)) : 0x00); /* flags: interlaced, second field */
AV_WB8 (&rtp_ctx->buf[3], parse_code);
if (size > 0)