27 #define MMS_MAX_STREAMS 256
34 size_to_copy =
FFMIN(size, remaining_size);
36 memcpy(buf, pos, size_to_copy);
64 "Corrupt stream (invalid ASF header, size=%d)\n",
79 if (!chunksize || chunksize > end - p) {
81 "Corrupt stream (header chunksize %"PRId64
" is invalid)\n",
91 "Corrupt stream (too large pkt_len %d)\n",
98 stream_id = flags & 0x7F;
111 "Corrupt stream (too many A/V streams)\n");
116 int stream_count =
AV_RL16(p + 84), ext_len_count =
AV_RL16(p + 86);
118 while (stream_count--) {
119 if (end - p < skip_bytes + 4) {
121 "Corrupt stream (next stream name length is not in the buffer)\n");
124 skip_bytes += 4 +
AV_RL16(p + skip_bytes + 2);
126 while (ext_len_count--) {
127 if (end - p < skip_bytes + 22) {
129 "Corrupt stream (next extension system info length is not in the buffer)\n");
132 skip_bytes += 22 +
AV_RL32(p + skip_bytes + 18);
134 if (end - p < skip_bytes) {
136 "Corrupt stream (the last extension system info length is invalid)\n");
139 if (chunksize - skip_bytes > 24)