[DVDnav-discuss] r1279 - trunk/libdvdnav/src/searching.c

rathann subversion at mplayerhq.hu
Tue Nov 12 00:49:18 CET 2013


Author: rathann
Date: Tue Nov 12 00:49:17 2013
New Revision: 1279

Log:
Avoid a crash when program number is zero.

This is a workaround for a crash at:
cellnr = pgc->program_map[ptt[i].pgn-1];
when playing "The Dictator".

Based on a patch by Ivan Kalvachev < ikalvachev AT gmail DOT com>.

Modified:
   trunk/libdvdnav/src/searching.c

Modified: trunk/libdvdnav/src/searching.c
==============================================================================
--- trunk/libdvdnav/src/searching.c	Mon Nov 11 22:50:30 2013	(r1278)
+++ trunk/libdvdnav/src/searching.c	Tue Nov 12 00:49:17 2013	(r1279)
@@ -629,7 +629,7 @@ uint32_t dvdnav_describe_title_chapters(
       printerr("Program map missing.");
       continue;
     }
-    if(ptt[i].pgn > pgc->nr_of_programs) {
+    if(ptt[i].pgn == 0 || ptt[i].pgn > pgc->nr_of_programs) {
       printerr("WRONG part number.");
       goto fail;
     }


More information about the DVDnav-discuss mailing list