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",
99 stream_id =
flags & 0x7F;
114 "Corrupt stream (too many A/V streams)\n");
120 int stream_count =
AV_RL16(p + 84), ext_len_count =
AV_RL16(p + 86);
122 while (stream_count--) {
125 "Corrupt stream (next stream name length is not in the buffer)\n");
130 while (ext_len_count--) {
133 "Corrupt stream (next extension system info length is not in the buffer)\n");
140 "Corrupt stream (the last extension system info length is invalid)\n");
148 if (chunksize > end - p) {
150 "Corrupt stream (header chunksize %"PRId64
" is invalid)\n",
const ff_asf_guid ff_asf_ext_stream_header
const ff_asf_guid ff_asf_stream_header
const ff_asf_guid ff_asf_header
const ff_asf_guid ff_asf_head1_guid
const ff_asf_guid ff_asf_data_header
const ff_asf_guid ff_asf_file_header
static av_unused const uint8_t * skip_bytes(CABACContext *c, int n)
Skip n bytes and reset the decoder.
#define flags(name, subs,...)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given buffer if it is not large enough, otherwise do nothing.
int ff_mms_asf_header_parser(MMSContext *mms)
int ff_mms_read_header(MMSContext *mms, uint8_t *buf, const int size)
#define MMS_MAX_STREAMS
arbitrary sanity check value
int ff_mms_read_data(MMSContext *mms, uint8_t *buf, const int size)
int stream_num
stream numbers.
uint8_t * asf_header
Internal handling of the ASF header.
uint8_t in_buffer[65536]
Buffer for incoming packets.
unsigned int nb_streams_allocated
allocated size of streams
int remaining_in_len
Reading length from incoming buffer.
URLContext * mms_hd
TCP connection handle.
int asf_header_size
Size of stored ASF header.
uint8_t out_buffer[512]
Buffer for outgoing packet.
uint8_t * read_in_ptr
Pointer for reading from incoming buffer.