# HG changeset patch # User nicodvb # Date 1180211265 0 # Node ID cef784b467ac01336df592103c6728e03764e9e1 # Parent ee2c8684c9250e9370756ff599c589a66ffbdeaf fixed off-by-one bug during chapter-listing; fixed by Jared Breland (list-mplayer@legroom.net) and me diff -r ee2c8684c925 -r cef784b467ac stream/stream_dvd.c --- a/stream/stream_dvd.c Fri May 25 16:31:16 2007 +0000 +++ b/stream/stream_dvd.c Sat May 26 20:27:45 2007 +0000 @@ -614,12 +614,12 @@ return; mp_msg(MSGT_IDENTIFY, MSGL_INFO, "CHAPTERS: "); - for(i=0; inr_of_programs-1; i++) + for(i=0; inr_of_programs; i++) { cell = pgc->program_map[i]; //here the cell is 1-based t2 = t/1000; mp_msg(MSGT_IDENTIFY, MSGL_INFO, "%02d:%02d:%02d,", t2/3600, (t2/60)%60, t2%60); - while(cell < pgc->program_map[i+1]) { + while(i+1nr_of_programs && cell < pgc->program_map[i+1]) { if(!(pgc->cell_playback[cell-1].block_type == BLOCK_TYPE_ANGLE_BLOCK && pgc->cell_playback[cell-1].block_mode != BLOCK_MODE_FIRST_CELL) )