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 = NULL;
62 if (tag !=
MKTAG(
'R',
'I',
'F',
'F'))
66 if (tag !=
MKTAG(
'X',
'W',
'M',
'A'))
71 if (tag !=
MKTAG(
'f',
'm',
't',
' '))
140 if (tag ==
MKTAG(
'd',
'a',
't',
'a')) {
143 }
else if (tag ==
MKTAG(
'd',
'p',
'd',
's')) {
164 "dpds chunk size %"PRId64
" not divisible by 4\n", size);
166 dpds_table_size = size / 4;
167 if (dpds_table_size == 0 || dpds_table_size >= INT_MAX / 4) {
169 "dpds chunk size %"PRId64
" invalid\n", size);
176 dpds_table =
av_malloc(dpds_table_size *
sizeof(uint32_t));
181 for (i = 0; i < dpds_table_size; ++i) {
200 if (dpds_table && dpds_table_size) {
202 const uint32_t bytes_per_sample
206 const uint64_t total_decoded_bytes = dpds_table[dpds_table_size - 1];
208 if (!bytes_per_sample) {
210 "Invalid bits_per_coded_sample %d for %d channels\n",
216 st->
duration = total_decoded_bytes / bytes_per_sample;
228 for (i = 0; i < dpds_table_size; ++i) {
235 dpds_table[i] / bytes_per_sample,
270 size =
FFMIN(size, left);