Mercurial > libdvdread4.hg
changeset 69:d35a5dd07b34 src
Conditional style change
author | erik |
---|---|
date | Sat, 13 Aug 2011 17:28:43 +0000 |
parents | 3748dde919dd |
children | f6cd5131324d |
files | ifo_read.c |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ifo_read.c Sat Aug 13 17:28:40 2011 +0000 +++ b/ifo_read.c Sat Aug 13 17:28:43 2011 +0000 @@ -1176,9 +1176,9 @@ info_length = vts_ptt_srpt->last_byte + 1 - VTS_PTT_SRPT_SIZE; data = malloc(info_length); - if(!data) { + if(!data) goto fail; - } + if(!(DVDReadBytes(ifofile->file, data, info_length))) { fprintf(stderr, "libdvdread: Unable to read PTT search table.\n"); goto fail; @@ -1196,19 +1196,21 @@ vts_ptt_srpt->ttu_offset = data; vts_ptt_srpt->title = malloc(vts_ptt_srpt->nr_of_srpts * sizeof(ttu_t)); - if(!vts_ptt_srpt->title) { + if(!vts_ptt_srpt->title) goto fail; - } + for(i = 0; i < vts_ptt_srpt->nr_of_srpts; i++) { int n; if(i < vts_ptt_srpt->nr_of_srpts - 1) n = (data[i+1] - data[i]); else n = (vts_ptt_srpt->last_byte + 1 - data[i]); + /* assert(n > 0 && (n % 4) == 0); Magic Knight Rayearth Daybreak is mastered very strange and has Titles with 0 PTTs. */ if(n < 0) n = 0; + CHECK_VALUE(n % 4 == 0); vts_ptt_srpt->title[i].nr_of_ptts = n / 4;