Browse Source

oggparsevorbis: Add some sanity checks to header packet ordering/presence.

Originally committed as revision 24740 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/n0.8
Alex Converse 15 years ago
parent
commit
73c44cb286
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      libavformat/oggparsevorbis.c

+ 6
- 0
libavformat/oggparsevorbis.c View File

@@ -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);


Loading…
Cancel
Save