summaryrefslogtreecommitdiffstats
path: root/libmpdvdkit2
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-09-10 20:33:31 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-09-10 20:33:31 +0000
commitf9963b5442a2242ec7d0476297cd386729e9e4a4 (patch)
tree4c0a3d9a5ce895c1f19b26dfc872b10d8f827790 /libmpdvdkit2
parent47902f3c8826bc95cd75be4a9d9c02d72acdab32 (diff)
downloadmpv-f9963b5442a2242ec7d0476297cd386729e9e4a4.tar.bz2
mpv-f9963b5442a2242ec7d0476297cd386729e9e4a4.tar.xz
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> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7359 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdvdkit2')
-rw-r--r--libmpdvdkit2/dvd_reader.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libmpdvdkit2/dvd_reader.c b/libmpdvdkit2/dvd_reader.c
index 037327700c..59ebc546a6 100644
--- a/libmpdvdkit2/dvd_reader.c
+++ b/libmpdvdkit2/dvd_reader.c
@@ -815,7 +815,10 @@ static int DVDReadBlocksPath( dvd_file_t *dvd_file, unsigned int offset,
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 );