changeset 7358:bb40478265df

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@isg.de> & H}kan Hjort <d95hjort@dtek.chalmers.se>
author arpi
date Tue, 10 Sep 2002 20:33:31 +0000
parents 69a4d7e59f3f
children 7b929a5d753e
files libmpdvdkit2/dvd_reader.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdvdkit2/dvd_reader.c	Tue Sep 10 20:07:34 2002 +0000
+++ b/libmpdvdkit2/dvd_reader.c	Tue Sep 10 20:33:31 2002 +0000
@@ -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 );