avformat/oggparsevorbis: Check that initialization succeeded before declaring the...
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 6 Nov 2014 11:58:04 +0000 (12:58 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 6 Nov 2014 12:02:08 +0000 (13:02 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/oggparsevorbis.c

index 87b8190..dd44337 100644 (file)
@@ -304,14 +304,14 @@ static int vorbis_header(AVFormatContext *s, int idx)
             return AVERROR(ENOMEM);
     }
 
+    priv = os->private;
+
     if (!(pkt_type & 1))
-        return 0;
+        return priv->vp ? 0 : AVERROR_INVALIDDATA;
 
     if (os->psize < 1 || pkt_type > 5)
         return AVERROR_INVALIDDATA;
 
-    priv = os->private;
-
     if (priv->packet[pkt_type >> 1])
         return AVERROR_INVALIDDATA;
     if (pkt_type > 1 && !priv->packet[0] || pkt_type > 3 && !priv->packet[1])