[Mplayer-cvslog] CVS: main/libmpdemux demux_avi.c,1.45,1.46

Arpi of Ize arpi at mplayerhq.hu
Thu Sep 26 00:19:14 CEST 2002


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv8781

Modified Files:
	demux_avi.c 
Log Message:
fixed invalid -aid/-vid segfault


Index: demux_avi.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_avi.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- demux_avi.c	22 Sep 2002 02:33:26 -0000	1.45
+++ demux_avi.c	25 Sep 2002 22:19:11 -0000	1.46
@@ -445,6 +445,16 @@
 
   //---- AVI header:
   read_avi_header(demuxer,(demuxer->stream->type!=STREAMTYPE_STREAM)?index_mode:-2);
+  
+  if(demuxer->audio->id>=0 && !demuxer->a_streams[demuxer->audio->id]){
+      mp_msg(MSGT_DEMUX,MSGL_WARN,"AVI: invalid audio stream ID: %d - ignoring (nosound)\n",demuxer->audio->id);
+      demuxer->audio->id=-2; // disabled
+  }
+  if(demuxer->video->id>=0 && !demuxer->v_streams[demuxer->video->id]){
+      mp_msg(MSGT_DEMUX,MSGL_WARN,"AVI: invalid video stream ID: %d - ignoring (using default)\n",demuxer->video->id);
+      demuxer->video->id=-1; // autodetect
+  }
+  
   stream_reset(demuxer->stream);
   stream_seek(demuxer->stream,demuxer->movi_start);
   priv->idx_pos=0;
@@ -518,7 +528,6 @@
   if(!ds_fill_buffer(d_video)){
     mp_msg(MSGT_DEMUX,MSGL_ERR,"AVI: " MSGTR_MissingVideoStreamBug);
     return NULL;
-//    GUI_MSG( mplAVIErrorMissingVideoStream )
   }
   sh_video=d_video->sh;sh_video->ds=d_video;
   if(d_audio->id!=-2){




More information about the MPlayer-cvslog mailing list