summaryrefslogtreecommitdiff
path: root/libavformat/oggparsevorbis.c
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2010-08-07 21:30:34 +0000
committerAlex Converse <alex.converse@gmail.com>2010-08-07 21:30:34 +0000
commit73c44cb2869bfdbea829942eb35efa6d4c4e2f91 (patch)
tree4918dfd702b7c50647b0145286192dc0d5b864b0 /libavformat/oggparsevorbis.c
parent2d7b5f091d9c9cdf3ceb59a51064c85be9d404df (diff)
oggparsevorbis: Add some sanity checks to header packet ordering/presence.
Originally committed as revision 24740 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/oggparsevorbis.c')
-rw-r--r--libavformat/oggparsevorbis.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index 886ef522b5..c7f8149a23 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -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);