changeset 17218:cffd0ec5d01a

fix crash with invalid -vid and no audio stream
author reimar
date Sun, 18 Dec 2005 11:55:47 +0000
parents 0d8eee43f85c
children fde45c312c31
files libmpdemux/demux_ogg.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ogg.c	Sun Dec 18 01:22:11 2005 +0000
+++ b/libmpdemux/demux_ogg.c	Sun Dec 18 11:55:47 2005 +0000
@@ -616,7 +616,7 @@
     if (((sh_video_t*)demuxer->video->sh)->format == FOURCC_THEORA)
       context = ((sh_video_t*)demuxer->video->sh)->context;
   }
-  else {
+  else if(demuxer->audio->id >= 0) {
     sid = demuxer->audio->id;
     /* demux_ogg_read_packet needs decoder context for Vorbis streams */
     if(((sh_audio_t*)demuxer->audio->sh)->format == FOURCC_VORBIS) {
@@ -624,6 +624,7 @@
       samplesize = ((sh_audio_t*)demuxer->audio->sh)->samplesize;
     }
   }
+  else return;
   os = &ogg_d->subs[sid];
   oss = &os->stream;