[DVDnav-discuss] r1007 - trunk/libdvdnav/src/dvdread/dvd_reader.c

nicodvb subversion at mplayerhq.hu
Sat Apr 19 11:40:03 CEST 2008


Author: nicodvb
Date: Sat Apr 19 11:40:03 2008
New Revision: 1007

Log:
prevent access to index ouf of bounds when iterating over titles; patch by Erik Hovland  - erik hovland org

Modified:
   trunk/libdvdnav/src/dvdread/dvd_reader.c

Modified: trunk/libdvdnav/src/dvdread/dvd_reader.c
==============================================================================
--- trunk/libdvdnav/src/dvdread/dvd_reader.c	(original)
+++ trunk/libdvdnav/src/dvdread/dvd_reader.c	Sat Apr 19 11:40:03 2008
@@ -971,7 +971,8 @@ static int DVDReadBlocksPath( dvd_file_t
                  * 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;
+		if( i + 1 >= TITLES_MAX || !dvd_file->title_devs[ i + 1 ] )
+                    return ret;
 
                 /* Read part 2 */
                 off = dvdinput_seek( dvd_file->title_devs[ i + 1 ], 0 );



More information about the DVDnav-discuss mailing list