| 160 | }; |
| 161 | |
| 162 | static 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 | |
| 182 | static int str_to_time(const char *str, int64_t *rtime) |
| 183 | { |
no test coverage detected