mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
rtpdec: Limit writing to the buffer size
This fixes potential buffer overwrites. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
48238fd00b
commit
81ef519252
@ -531,7 +531,7 @@ static int rtp_parse_packet_internal(RTPDemuxContext *s, AVPacket *pkt,
|
||||
if (ret < 0)
|
||||
return AVERROR(EAGAIN);
|
||||
if (ret < len) {
|
||||
s->read_buf_size = len - ret;
|
||||
s->read_buf_size = FFMIN(len - ret, sizeof(s->buf));
|
||||
memcpy(s->buf, buf + ret, s->read_buf_size);
|
||||
s->read_buf_index = 0;
|
||||
return 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user