33 #if FF_API_DESTRUCT_PACKET
58 #if FF_API_DESTRUCT_PACKET
94 #if FF_API_DESTRUCT_PACKET
105 if (pkt->
size <= size)
117 if ((
unsigned)grow_by >
131 #if FF_API_DESTRUCT_PACKET
138 pkt->
size += grow_by;
139 memset(pkt->
data + pkt->
size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
156 #if FF_API_DESTRUCT_PACKET
165 #define ALLOC_MALLOC(data, size) data = av_malloc(size)
166 #define ALLOC_BUF(data, size) \
168 av_buffer_realloc(&pkt->buf, size); \
169 data = pkt->buf ? pkt->buf->data : NULL; \
172 #define DUP_DATA(dst, src, size, padding, ALLOC) \
176 if ((unsigned)(size) > \
177 (unsigned)(size) + FF_INPUT_BUFFER_PADDING_SIZE) \
179 ALLOC(data, size + FF_INPUT_BUFFER_PADDING_SIZE); \
185 memcpy(data, src, size); \
187 memset((uint8_t *)data + size, 0, \
188 FF_INPUT_BUFFER_PADDING_SIZE); \
206 #if FF_API_DESTRUCT_PACKET
286 #if FF_API_DESTRUCT_PACKET
304 if ((
unsigned)elems + 1 > INT_MAX /
sizeof(*pkt->
side_data))
339 #define FF_MERGE_MARKER 0x8c4d9d108e25e9feULL
358 #if FF_API_DESTRUCT_PACKET
372 memset(p, 0, FF_INPUT_BUFFER_PADDING_SIZE);
390 if (size>INT_MAX || p - pkt->
data < size)
411 pkt->
size -= size + 5;
433 const size_t keylen = strlen(t->
key);
434 const size_t valuelen = strlen(t->
value);
435 const size_t new_size = *size + keylen + 1 + valuelen + 1;
441 if (new_size > INT_MAX)
444 memcpy(data + *size, t->
key, keylen + 1);
445 memcpy(data + *size + keylen + 1, t->
value, valuelen + 1);
463 if (!dict || !data || !size)
477 data = val + strlen(val) + 1;
521 memcpy(dst_data, src_data, size);