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;
113 "Corrupt stream (too many A/V streams)\n");
118 int stream_count =
AV_RL16(p + 84), ext_len_count =
AV_RL16(p + 86);
120 while (stream_count--) {
121 if (end - p < skip_bytes + 4) {
123 "Corrupt stream (next stream name length is not in the buffer)\n");
126 skip_bytes += 4 +
AV_RL16(p + skip_bytes + 2);
128 while (ext_len_count--) {
129 if (end - p < skip_bytes + 22) {
131 "Corrupt stream (next extension system info length is not in the buffer)\n");
134 skip_bytes += 22 +
AV_RL32(p + skip_bytes + 18);
136 if (end - p < skip_bytes) {
138 "Corrupt stream (the last extension system info length is invalid)\n");
141 if (chunksize - skip_bytes > 24)
const ff_asf_guid ff_asf_header
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
unsigned int nb_streams_allocated
allocated size of streams
uint8_t * read_in_ptr
Pointer for reading from incoming buffer.
int ff_mms_read_header(MMSContext *mms, uint8_t *buf, const int size)
int stream_num
stream numbers.
#define MMS_MAX_STREAMS
arbitrary sanity check value
const ff_asf_guid ff_asf_ext_stream_header
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
uint8_t * asf_header
Internal handling of the ASF header.
const ff_asf_guid ff_asf_data_header
static av_cold int end(AVCodecContext *avctx)
int ff_mms_read_data(MMSContext *mms, uint8_t *buf, const int size)
static av_unused const uint8_t * skip_bytes(CABACContext *c, int n)
Skip n bytes and reset the decoder.
uint8_t in_buffer[65536]
Buffer for incoming packets.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const ff_asf_guid ff_asf_head1_guid
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.
uint8_t out_buffer[512]
Buffer for outgoing packet.
int remaining_in_len
Reading length from incoming buffer.
const ff_asf_guid ff_asf_file_header
const ff_asf_guid ff_asf_stream_header
int asf_header_size
Size of stored ASF header.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
int ff_mms_asf_header_parser(MMSContext *mms)