mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-11-06 05:17:42 +00:00
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:
1 parent
bceb10aa04
commit
5c25cb3453
3 files changed
+4
-1
No files matched your search
@@ -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++;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user