[1/2] rtpdec: Fix the minimum packet length for RTCP SR packets

Message ID 1318407542-45536-1-git-send-email-martin@martin.st
State Committed
Commit 5d6ecf5345c0913e2b66427ea062e7989201a139
Headers show

Commit Message

Martin Storsjö Oct. 12, 2011, 8:19 a.m.
From: John Brooks <john.brooks@bluecherry.net>

We actually read 20 bytes of these packets.
---
 libavformat/rtpdec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Anton Khirnov Oct. 12, 2011, 9:03 a.m. | #1
On Wed, 12 Oct 2011 11:19:01 +0300, Martin Storsjö <martin@martin.st> wrote:
> From: John Brooks <john.brooks@bluecherry.net>
> 
> We actually read 20 bytes of these packets.
> ---
>  libavformat/rtpdec.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 

LGTM

Patch

diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 3712260..07f4cc3 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -115,7 +115,7 @@  static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf, int l
     while (len >= 2) {
         switch (buf[1]) {
         case RTCP_SR:
-            if (len < 16) {
+            if (len < 20) {
                 av_log(NULL, AV_LOG_ERROR, "Invalid length for RTCP SR packet\n");
                 return AVERROR_INVALIDDATA;
             }