Lines 60-71
Link Here
|
60 |
fprintf(stderr, "\n"); \ |
60 |
fprintf(stderr, "\n"); \ |
61 |
} |
61 |
} |
62 |
|
62 |
|
63 |
static const uint8_t my_friendly_zeros[2048]; |
|
|
64 |
#else |
63 |
#else |
65 |
#define CHECK_ZERO0(arg) (void)(arg) |
64 |
#define CHECK_ZERO0(arg) (void)(arg) |
66 |
#define CHECK_ZERO(arg) (void)(arg) |
65 |
#define CHECK_ZERO(arg) (void)(arg) |
67 |
#endif |
66 |
#endif |
68 |
|
67 |
|
|
|
68 |
static const uint8_t my_friendly_zeros[2048] = { |
69 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
70 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
71 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
72 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
73 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
74 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
75 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
76 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
77 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
78 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
79 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
80 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
81 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
82 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
83 |
0, 0, 0, 0, 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for internal functions */ |
208 |
/* Prototypes for internal functions */ |
71 |
static int ifoRead_VMG(ifo_handle_t *ifofile); |
209 |
static int ifoRead_VMG(ifo_handle_t *ifofile); |
Lines 679-685
Link Here
|
679 |
} |
817 |
} |
680 |
|
818 |
|
681 |
if(pgc->command_tbl_offset != 0) { |
819 |
if(pgc->command_tbl_offset != 0) { |
682 |
pgc->command_tbl = malloc(sizeof(pgc_command_tbl_t)); |
820 |
pgc->command_tbl = (pgc_command_tbl_t*) malloc(sizeof(pgc_command_tbl_t)); |
683 |
if(!pgc->command_tbl) |
821 |
if(!pgc->command_tbl) |
684 |
return 0; |
822 |
return 0; |
685 |
|
823 |
|
Lines 693-699
Link Here
|
693 |
} |
831 |
} |
694 |
|
832 |
|
695 |
if(pgc->program_map_offset != 0) { |
833 |
if(pgc->program_map_offset != 0) { |
696 |
pgc->program_map = malloc(pgc->nr_of_programs * sizeof(pgc_program_map_t)); |
834 |
pgc->program_map = (pgc_program_map_t*) malloc(pgc->nr_of_programs * sizeof(pgc_program_map_t)); |
697 |
if(!pgc->program_map) { |
835 |
if(!pgc->program_map) { |
698 |
ifoFree_PGC_COMMAND_TBL(pgc->command_tbl); |
836 |
ifoFree_PGC_COMMAND_TBL(pgc->command_tbl); |
699 |
return 0; |
837 |
return 0; |
Lines 709-715
Link Here
|
709 |
} |
847 |
} |
710 |
|
848 |
|
711 |
if(pgc->cell_playback_offset != 0) { |
849 |
if(pgc->cell_playback_offset != 0) { |
712 |
pgc->cell_playback = malloc(pgc->nr_of_cells * sizeof(cell_playback_t)); |
850 |
pgc->cell_playback = (cell_playback_t*) malloc(pgc->nr_of_cells * sizeof(cell_playback_t)); |
713 |
if(!pgc->cell_playback) { |
851 |
if(!pgc->cell_playback) { |
714 |
ifoFree_PGC_COMMAND_TBL(pgc->command_tbl); |
852 |
ifoFree_PGC_COMMAND_TBL(pgc->command_tbl); |
715 |
if(pgc->program_map) |
853 |
if(pgc->program_map) |
Lines 730-736
Link Here
|
730 |
} |
868 |
} |
731 |
|
869 |
|
732 |
if(pgc->cell_position_offset != 0) { |
870 |
if(pgc->cell_position_offset != 0) { |
733 |
pgc->cell_position = malloc(pgc->nr_of_cells * sizeof(cell_position_t)); |
871 |
pgc->cell_position = (cell_position_t*) malloc(pgc->nr_of_cells * sizeof(cell_position_t)); |
734 |
if(!pgc->cell_position) { |
872 |
if(!pgc->cell_position) { |
735 |
ifoFree_PGC(pgc); |
873 |
ifoFree_PGC(pgc); |
736 |
return 0; |
874 |
return 0; |
Lines 963-969
Link Here
|
963 |
|
1101 |
|
964 |
vts_ptt_srpt->ttu_offset = data; |
1102 |
vts_ptt_srpt->ttu_offset = data; |
965 |
|
1103 |
|
966 |
vts_ptt_srpt->title = malloc(vts_ptt_srpt->nr_of_srpts * sizeof(ttu_t)); |
1104 |
vts_ptt_srpt->title = (ttu_t*) malloc(vts_ptt_srpt->nr_of_srpts * sizeof(ttu_t)); |
967 |
if(!vts_ptt_srpt->title) { |
1105 |
if(!vts_ptt_srpt->title) { |
968 |
free(vts_ptt_srpt); |
1106 |
free(vts_ptt_srpt); |
969 |
free(data); |
1107 |
free(data); |
Lines 983-989
Link Here
|
983 |
CHECK_VALUE(n % 4 == 0); |
1121 |
CHECK_VALUE(n % 4 == 0); |
984 |
|
1122 |
|
985 |
vts_ptt_srpt->title[i].nr_of_ptts = n / 4; |
1123 |
vts_ptt_srpt->title[i].nr_of_ptts = n / 4; |
986 |
vts_ptt_srpt->title[i].ptt = malloc(n * sizeof(ptt_info_t)); |
1124 |
vts_ptt_srpt->title[i].ptt = (ptt_info_t*) malloc(n * sizeof(ptt_info_t)); |
987 |
if(!vts_ptt_srpt->title[i].ptt) { |
1125 |
if(!vts_ptt_srpt->title[i].ptt) { |
988 |
for(n = 0; n < i; n++) |
1126 |
for(n = 0; n < i; n++) |
989 |
free(vts_ptt_srpt->title[n].ptt); |
1127 |
free(vts_ptt_srpt->title[n].ptt); |
Lines 1619-1625
Link Here
|
1619 |
CHECK_VALUE(pgcit->nr_of_pgci_srp < 10000); // ?? seen max of 1338 |
1757 |
CHECK_VALUE(pgcit->nr_of_pgci_srp < 10000); // ?? seen max of 1338 |
1620 |
|
1758 |
|
1621 |
info_length = pgcit->nr_of_pgci_srp * PGCI_SRP_SIZE; |
1759 |
info_length = pgcit->nr_of_pgci_srp * PGCI_SRP_SIZE; |
1622 |
data = malloc(info_length); |
1760 |
data = (uint8_t*) malloc(info_length); |
1623 |
if(!data) |
1761 |
if(!data) |
1624 |
return 0; |
1762 |
return 0; |
1625 |
|
1763 |
|
Lines 1628-1634
Link Here
|
1628 |
return 0; |
1766 |
return 0; |
1629 |
} |
1767 |
} |
1630 |
|
1768 |
|
1631 |
pgcit->pgci_srp = malloc(pgcit->nr_of_pgci_srp * sizeof(pgci_srp_t)); |
1769 |
pgcit->pgci_srp = (pgci_srp_t*) malloc(pgcit->nr_of_pgci_srp * sizeof(pgci_srp_t)); |
1632 |
if(!pgcit->pgci_srp) { |
1770 |
if(!pgcit->pgci_srp) { |
1633 |
free(data); |
1771 |
free(data); |
1634 |
return 0; |
1772 |
return 0; |
Lines 1647-1653
Link Here
|
1647 |
CHECK_VALUE(pgcit->pgci_srp[i].pgc_start_byte + PGC_SIZE <= pgcit->last_byte+1); |
1785 |
CHECK_VALUE(pgcit->pgci_srp[i].pgc_start_byte + PGC_SIZE <= pgcit->last_byte+1); |
1648 |
|
1786 |
|
1649 |
for(i = 0; i < pgcit->nr_of_pgci_srp; i++) { |
1787 |
for(i = 0; i < pgcit->nr_of_pgci_srp; i++) { |
1650 |
pgcit->pgci_srp[i].pgc = malloc(sizeof(pgc_t)); |
1788 |
pgcit->pgci_srp[i].pgc = (pgc_t*) malloc(sizeof(pgc_t)); |
1651 |
if(!pgcit->pgci_srp[i].pgc) { |
1789 |
if(!pgcit->pgci_srp[i].pgc) { |
1652 |
int j; |
1790 |
int j; |
1653 |
for(j = 0; j < i; j++) { |
1791 |
for(j = 0; j < i; j++) { |
Lines 1741-1747
Link Here
|
1741 |
CHECK_VALUE((uint32_t)pgci_ut->nr_of_lus * PGCI_LU_SIZE < pgci_ut->last_byte); |
1879 |
CHECK_VALUE((uint32_t)pgci_ut->nr_of_lus * PGCI_LU_SIZE < pgci_ut->last_byte); |
1742 |
|
1880 |
|
1743 |
info_length = pgci_ut->nr_of_lus * PGCI_LU_SIZE; |
1881 |
info_length = pgci_ut->nr_of_lus * PGCI_LU_SIZE; |
1744 |
data = malloc(info_length); |
1882 |
data = (uint8_t*) malloc(info_length); |
1745 |
if(!data) { |
1883 |
if(!data) { |
1746 |
free(pgci_ut); |
1884 |
free(pgci_ut); |
1747 |
ifofile->pgci_ut = 0; |
1885 |
ifofile->pgci_ut = 0; |
Lines 1754-1760
Link Here
|
1754 |
return 0; |
1892 |
return 0; |
1755 |
} |
1893 |
} |
1756 |
|
1894 |
|
1757 |
pgci_ut->lu = malloc(pgci_ut->nr_of_lus * sizeof(pgci_lu_t)); |
1895 |
pgci_ut->lu = (pgci_lu_t*) malloc(pgci_ut->nr_of_lus * sizeof(pgci_lu_t)); |
1758 |
if(!pgci_ut->lu) { |
1896 |
if(!pgci_ut->lu) { |
1759 |
free(data); |
1897 |
free(data); |
1760 |
free(pgci_ut); |
1898 |
free(pgci_ut); |
Lines 1784-1790
Link Here
|
1784 |
} |
1922 |
} |
1785 |
|
1923 |
|
1786 |
for(i = 0; i < pgci_ut->nr_of_lus; i++) { |
1924 |
for(i = 0; i < pgci_ut->nr_of_lus; i++) { |
1787 |
pgci_ut->lu[i].pgcit = malloc(sizeof(pgcit_t)); |
1925 |
pgci_ut->lu[i].pgcit = (pgcit_t*) malloc(sizeof(pgcit_t)); |
1788 |
if(!pgci_ut->lu[i].pgcit) { |
1926 |
if(!pgci_ut->lu[i].pgcit) { |
1789 |
unsigned int j; |
1927 |
unsigned int j; |
1790 |
for(j = 0; j < i; j++) { |
1928 |
for(j = 0; j < i; j++) { |