# HG changeset patch # User arpi # Date 1031690011 0 # Node ID bb40478265df9ee1021c42b22ec44b3edb92275d # Parent 69a4d7e59f3f33a72c6aa3894eb6f3254550035d 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 & H}kan Hjort diff -r 69a4d7e59f3f -r bb40478265df libmpdvdkit2/dvd_reader.c --- 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 );