From 4838cdab21e1f7d0f43d2a1649646ff068b4bb1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 6 Dec 2010 12:43:38 +0000 Subject: [PATCH] rtpdec: Skip padding bytes at the end of packets Originally committed as revision 25896 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/rtpdec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c index c9cf855a59..638fbdd119 100644 --- a/libavformat/rtpdec.c +++ b/libavformat/rtpdec.c @@ -475,6 +475,12 @@ static int rtp_parse_packet_internal(RTPDemuxContext *s, AVPacket *pkt, return -1; } + if (buf[0] & 0x20) { + int padding = buf[len - 1]; + if (len >= 12 + padding) + len -= padding; + } + s->seq = seq; len -= 12; buf += 12;