MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / alloc_array_elem

Function alloc_array_elem

libavformat/sbgdec.c:162–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160};
161
162static void *alloc_array_elem(void **array, size_t elsize,
163 int *size, int *max_size)
164{
165 void *ret;
166
167 if (*size == *max_size) {
168 int m = FFMAX(32, FFMIN(*max_size, INT_MAX / 2) * 2);
169 if (*size >= m)
170 return NULL;
171 *array = av_realloc_f(*array, m, elsize);
172 if (!*array)
173 return NULL;
174 *max_size = m;
175 }
176 ret = (char *)*array + elsize * *size;
177 memset(ret, 0, elsize);
178 (*size)++;
179 return ret;
180}
181
182static int str_to_time(const char *str, int64_t *rtime)
183{

Callers 5

parse_time_sequenceFunction · 0.85
parse_synth_channelFunction · 0.85
parse_named_defFunction · 0.85
expand_tseqFunction · 0.85
add_intervalFunction · 0.85

Calls 1

av_realloc_fFunction · 0.85

Tested by

no test coverage detected