Skip to content

Commit 0857141

Browse files
Franciszek Kalinowskimichaelni
authored andcommitted
avformat/rtpenc_xiph: bail out when the max payload size underflows
Reported by Franciszek Kalinowski (isec.pl / striga.ai) and Bartosz Smigielski.
1 parent a44cae9 commit 0857141

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

libavformat/rtpenc_xiph.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size)
3838
uint8_t *q;
3939

4040
max_pkt_size = s->max_payload_size - 6; // ident+frag+tdt/vdt+pkt_num+pkt_length
41+
if (max_pkt_size <= 0) {
42+
av_log(s1, AV_LOG_ERROR, "Max payload size too small for Xiph RTP\n");
43+
return;
44+
}
4145

4246
// set xiph data type
4347
switch (*buff) {

0 commit comments

Comments
 (0)