mirror of https://git.ffmpeg.org/ffmpeg.git
rtpproto: Check the size before reading buf[1]
I doubt that anyone ever would try to send a 1 byte packet via the RTP protocol, but check just in case - it shouldn't crash at least. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
7748dd41be
commit
1851e1d05d
|
@ -368,6 +368,9 @@ static int rtp_write(URLContext *h, const uint8_t *buf, int size)
|
|||
int ret;
|
||||
URLContext *hd;
|
||||
|
||||
if (size < 2)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
if (RTP_PT_IS_RTCP(buf[1])) {
|
||||
/* RTCP payload type */
|
||||
hd = s->rtcp_hd;
|
||||
|
|
Loading…
Reference in New Issue