check for sane values in ogg_get_length(), fix lol-ffplay.ogm fuzz test

Originally committed as revision 7536 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Måns Rullgård 2007-01-15 22:45:50 +00:00
parent 20be72c890
commit e22f2aaf99
1 changed files with 2 additions and 1 deletions

View File

@ -484,7 +484,8 @@ ogg_get_length (AVFormatContext * s)
url_fseek (&s->pb, end, SEEK_SET); url_fseek (&s->pb, end, SEEK_SET);
while (!ogg_read_page (s, &i)){ while (!ogg_read_page (s, &i)){
if (ogg->streams[i].granule != -1 && ogg->streams[i].granule != 0) if (ogg->streams[i].granule != -1 && ogg->streams[i].granule != 0 &&
ogg->streams[i].codec)
idx = i; idx = i;
} }