changeset 6351:05a6d7c6813e libavformat

oggparsevorbis: Add some sanity checks to header packet ordering/presence.
author alexc
date Sat, 07 Aug 2010 21:30:34 +0000
parents aea92c85d611
children 3472338a5e13
files oggparsevorbis.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/oggparsevorbis.c	Sat Aug 07 14:11:43 2010 +0000
+++ b/oggparsevorbis.c	Sat Aug 07 21:30:34 2010 +0000
@@ -206,6 +206,12 @@
         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);