comparison searching.c @ 426:79921c6bb4e8 src

This is a heuristic to prevent segfaults when ifo->vts_pgcit->pgci_srp[ptt[i].pgcn-1].pgc is invalid but non-NULL. Patch by Fabian Keil #fk$fabiankeil%de^
author rathann
date Thu, 03 Oct 2013 22:21:29 +0000
parents 323e54a7f200
children c53e528905ec
comparison
equal deleted inserted replaced
425:323e54a7f200 426:79921c6bb4e8
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 (ifo->vts_pgcit->pgci_srp[ptt[i].pgcn-1].pgc_start_byte >= ifo->vts_pgcit->last_byte) {
620 printerr("PGC start out of bounds");
621 continue;
622 }
619 pgc = ifo->vts_pgcit->pgci_srp[ptt[i].pgcn-1].pgc; 623 pgc = ifo->vts_pgcit->pgci_srp[ptt[i].pgcn-1].pgc;
620 if (pgc == NULL) { 624 if (pgc == NULL) {
621 printerr("PGC missing."); 625 printerr("PGC missing.");
622 continue; 626 continue;
623 } 627 }