Browse code

rtpdec: Skip padding bytes at the end of packets

Originally committed as revision 25896 to svn://svn.ffmpeg.org/ffmpeg/trunk

Martin Storsjö authored on 2010/12/06 21:43:38
Showing 1 changed files
... ...
@@ -475,6 +475,12 @@ static int rtp_parse_packet_internal(RTPDemuxContext *s, AVPacket *pkt,
475 475
         return -1;
476 476
     }
477 477
 
478
+    if (buf[0] & 0x20) {
479
+        int padding = buf[len - 1];
480
+        if (len >= 12 + padding)
481
+            len -= padding;
482
+    }
483
+
478 484
     s->seq = seq;
479 485
     len -= 12;
480 486
     buf += 12;