Commit c04c43b3 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/oggparsevorbis: Check that initialization succeeded before declaring the end of headers

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 4b2763cd
...@@ -304,14 +304,14 @@ static int vorbis_header(AVFormatContext *s, int idx) ...@@ -304,14 +304,14 @@ static int vorbis_header(AVFormatContext *s, int idx)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
priv = os->private;
if (!(pkt_type & 1)) if (!(pkt_type & 1))
return 0; return priv->vp ? 0 : AVERROR_INVALIDDATA;
if (os->psize < 1 || pkt_type > 5) if (os->psize < 1 || pkt_type > 5)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
priv = os->private;
if (priv->packet[pkt_type >> 1]) if (priv->packet[pkt_type >> 1])
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
if (pkt_type > 1 && !priv->packet[0] || pkt_type > 3 && !priv->packet[1]) if (pkt_type > 1 && !priv->packet[0] || pkt_type > 3 && !priv->packet[1])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment