comparison searching.c @ 437:d8ec83537d07 src

Check for out-of-bounds values for pgcn Fixes a crash in dvdnav_describe_title_chapters() with vlc, lsdvd, and other video players caused by an invalid value for pgcn. This occurs with the "Inside Man" DVD. Based on patches by Bryce Harrington <bryce AT canonical DOT com> and Vincent Mussard <frodon AT wanadoo DOT fr>
author rathann
date Tue, 12 Nov 2013 00:55:10 +0000
parents a566d307173d
children
comparison
equal deleted inserted replaced
436:a566d307173d 437:d8ec83537d07
614 goto fail; 614 goto fail;
615 615
616 length = 0; 616 length = 0;
617 for(i=0; i<parts; i++) { 617 for(i=0; i<parts; i++) {
618 uint32_t cellnr, endcellnr; 618 uint32_t cellnr, endcellnr;
619 if (ptt[i].pgcn == 0 || ptt[i].pgcn > ifo->vts_pgcit->nr_of_pgci_srp) {
620 printerr("PGCN out of bounds.");
621 continue;
622 }
619 if (ifo->vts_pgcit->pgci_srp[ptt[i].pgcn-1].pgc_start_byte >= ifo->vts_pgcit->last_byte) { 623 if (ifo->vts_pgcit->pgci_srp[ptt[i].pgcn-1].pgc_start_byte >= ifo->vts_pgcit->last_byte) {
620 printerr("PGC start out of bounds"); 624 printerr("PGC start out of bounds");
621 continue; 625 continue;
622 } 626 }
623 pgc = ifo->vts_pgcit->pgci_srp[ptt[i].pgcn-1].pgc; 627 pgc = ifo->vts_pgcit->pgci_srp[ptt[i].pgcn-1].pgc;