[Mplayer-cvslog] CVS: main/libmpdvdkit2 dvd_reader.c,1.2,1.3

Arpi of Ize arpi at mplayerhq.hu
Tue Sep 10 22:33:35 CEST 2002


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

Modified Files:
	dvd_reader.c 
Log Message:
I experienced several segfaults when trying to play (unencrypted) DVDs
from harddisk using xine/ogle/mplayer with the respective libdvdnav
support feature.

I found that while libdvdnav itself may do something wrong by trying
to read beyond the end of the files, it was actually the fault of libdvdread
that a segfault resulted. The following tiny patch fixes the problem
and it seems that libdvdnav can very well live with the "short read"
result it gets then - navigation worked fine after applying the patch:

patch by Peter Niemayer <niemayer at isg.de> & H}kan Hjort <d95hjort at dtek.chalmers.se>


Index: dvd_reader.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdvdkit2/dvd_reader.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- dvd_reader.c	16 Aug 2002 22:50:21 -0000	1.2
+++ dvd_reader.c	10 Sep 2002 20:33:31 -0000	1.3
@@ -815,7 +815,10 @@
 		if( ret < 0 ) return ret;
 		/* FIXME: This is wrong if i is the last file in the set. 
                  * also error from this read will not show in ret. */
-		
+
+                /* Does the next part exist? If not then return now. */
+                if( !dvd_file->title_devs[ i + 1 ] ) return ret;
+
                 /* Read part 2 */
                 off = DVDinput_seek( dvd_file->title_devs[ i + 1 ], 
 				     0, DVDINPUT_NOFLAGS );




More information about the MPlayer-cvslog mailing list