oggdec: Safety check against stream counts being inconsistent in seek()
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Apr 2012 12:44:06 +0000 (14:44 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Apr 2012 12:44:06 +0000 (14:44 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/oggdec.c

index ab52379..6a55f89 100644 (file)
@@ -29,6 +29,7 @@
  */
 
 #include <stdio.h>
+#include "libavutil/avassert.h"
 #include "oggdec.h"
 #include "avformat.h"
 #include "internal.h"
@@ -690,6 +691,7 @@ static int ogg_read_seek(AVFormatContext *s, int stream_index,
     struct ogg_stream *os = ogg->streams + stream_index;
     int ret;
 
+    av_assert0(stream_index < ogg->nstreams);
     // Ensure everything is reset even when seeking via
     // the generated index.
     ogg_reset(ogg);