mirror of https://github.com/mpv-player/mpv
stream_dvd: prevent segmentation fault with some broken files
I have a sample where some final chapters are missing. This was causing a segmentation fault when trying to fetch chapter times for them. This makes the code ignore those chapters.
This commit is contained in:
parent
29edc86721
commit
855b705980
|
@ -496,7 +496,7 @@ static int get_chapter_time(ifo_handle_t *vts_file, tt_srpt_t *tt_srpt, int titl
|
||||||
last_cell = pgc->program_map[ptt[i].pgn];
|
last_cell = pgc->program_map[ptt[i].pgn];
|
||||||
else
|
else
|
||||||
last_cell = 0;
|
last_cell = 0;
|
||||||
do {
|
while (cell < last_cell) {
|
||||||
if(!(pgc->cell_playback[cell-1].block_type == BLOCK_TYPE_ANGLE_BLOCK &&
|
if(!(pgc->cell_playback[cell-1].block_type == BLOCK_TYPE_ANGLE_BLOCK &&
|
||||||
pgc->cell_playback[cell-1].block_mode != BLOCK_MODE_FIRST_CELL)
|
pgc->cell_playback[cell-1].block_mode != BLOCK_MODE_FIRST_CELL)
|
||||||
) {
|
) {
|
||||||
|
@ -508,7 +508,7 @@ static int get_chapter_time(ifo_handle_t *vts_file, tt_srpt_t *tt_srpt, int titl
|
||||||
cur++;
|
cur++;
|
||||||
}
|
}
|
||||||
cell++;
|
cell++;
|
||||||
} while(cell < last_cell);
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue