[Mplayer-advusers] patch for previously described bug

Greg Stark gsstark at mit.edu
Fri May 16 21:49:24 CEST 2003


So I'm not sure if this video file is corrupt or if there's a bug elsewhere
but it seems read_video_properties() doesn't check its arguments at all.

I'm a bit puzzled why no video stream is found but I don't really have any
solid evidence that there is a valid video stream either. I added a check for
the lack of a video stream and now at least I just get a clean exit:

ASF: No video stream found.
ASF: No audio stream found -> no sound.
Video: Cannot read properties.
No stream found.


Exiting... (End of file)


--- libmpdemux/video.c.~1.39.~	2003-04-04 10:38:46.000000000 -0500
+++ libmpdemux/video.c	2003-05-16 15:43:34.000000000 -0400
@@ -35,8 +35,11 @@
 static float telecine_cnt=-2.5;
 
 int video_read_properties(sh_video_t *sh_video){
-demux_stream_t *d_video=sh_video->ds;
-
+demux_stream_t *d_video = sh_video->ds;
+if (!d_video) {
+  return 0;
+}
+   
 // Determine image properties:
 switch(d_video->demuxer->file_format){
  case DEMUXER_TYPE_AVI:


PS: I couldn't for the life of me figure out the indentation style in use
    here, I tried to mimic what I saw though.

-- 
greg



More information about the MPlayer-advusers mailing list