[FFmpeg-cvslog] r24740 - trunk/libavformat/oggparsevorbis.c

alexc subversion
Sat Aug 7 23:30:35 CEST 2010


Author: alexc
Date: Sat Aug  7 23:30:34 2010
New Revision: 24740

Log:
oggparsevorbis: Add some sanity checks to header packet ordering/presence.

Modified:
   trunk/libavformat/oggparsevorbis.c

Modified: trunk/libavformat/oggparsevorbis.c
==============================================================================
--- trunk/libavformat/oggparsevorbis.c	Sat Aug  7 23:06:46 2010	(r24739)
+++ trunk/libavformat/oggparsevorbis.c	Sat Aug  7 23:30:34 2010	(r24740)
@@ -206,6 +206,12 @@ vorbis_header (AVFormatContext * s, int 
         return -1;
 
     priv = os->private;
+
+    if (priv->packet[pkt_type>>1])
+        return -1;
+    if (pkt_type > 1 && !priv->packet[0] || pkt_type > 3 && !priv->packet[1])
+        return -1;
+
     priv->len[pkt_type >> 1] = os->psize;
     priv->packet[pkt_type >> 1] = av_mallocz(os->psize);
     memcpy(priv->packet[pkt_type >> 1], os->buf + os->pstart, os->psize);



More information about the ffmpeg-cvslog mailing list