39 if (!memcmp(p->
buf,
"RIFF", 4) && !memcmp(p->
buf + 8,
"XWMA", 4))
48 uint32_t dpds_table_size = 0;
49 uint32_t *dpds_table = 0;
62 if (tag !=
MKTAG(
'R',
'I',
'F',
'F'))
66 if (tag !=
MKTAG(
'X',
'W',
'M',
'A'))
71 if (tag !=
MKTAG(
'f',
'm',
't',
' '))
138 if (tag ==
MKTAG(
'd',
'a',
't',
'a')) {
141 }
else if (tag ==
MKTAG(
'd',
'p',
'd',
's')) {
161 "dpds chunk size %"PRId64
" not divisible by 4\n", size);
163 dpds_table_size = size / 4;
164 if (dpds_table_size == 0 || dpds_table_size >= INT_MAX / 4) {
166 "dpds chunk size %"PRId64
" invalid\n", size);
173 dpds_table =
av_malloc(dpds_table_size *
sizeof(uint32_t));
178 for (i = 0; i < dpds_table_size; ++i) {
195 if (dpds_table && dpds_table_size) {
197 const uint32_t bytes_per_sample
201 const uint64_t total_decoded_bytes = dpds_table[dpds_table_size - 1];
203 if (!bytes_per_sample) {
205 "Invalid bits_per_coded_sample %d for %d channels\n",
210 st->
duration = total_decoded_bytes / bytes_per_sample;
222 for (i = 0; i < dpds_table_size; ++i) {
229 dpds_table[i] / bytes_per_sample,
263 size =
FFMIN(size, left);