Skip to content

Commit

Permalink
oggparsevorbis: Add some sanity checks to header packet ordering/pres…
Browse files Browse the repository at this point in the history
…ence.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@24740 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
  • Loading branch information
aconverse committed Aug 7, 2010
1 parent 7e590df commit 4c4cf78
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libavformat/oggparsevorbis.c
Expand Up @@ -206,6 +206,12 @@ vorbis_header (AVFormatContext * s, int idx)
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);
Expand Down

0 comments on commit 4c4cf78

Please sign in to comment.