1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

lavf/rtpdec: fix RTCP SR packet length check

The minimum valid packet length is 28, given that the length includes
the packet header.

This didn't cause any issues so far as the code did not care about the
last two fields in the SR section, but will be relevant in a future
commit.
This commit is contained in:
Marvin Scholz
2025-04-24 20:36:52 +02:00
parent 019ca5f013
commit e0abe0a02a

View File

@ -187,7 +187,7 @@ static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf,
switch (buf[1]) { switch (buf[1]) {
case RTCP_SR: case RTCP_SR:
if (payload_len < 20) { if (payload_len < 28) {
av_log(s->ic, AV_LOG_ERROR, "Invalid RTCP SR packet length\n"); av_log(s->ic, AV_LOG_ERROR, "Invalid RTCP SR packet length\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }