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

Function add_side_data_from_buf_ext

libavutil/side_data.c:142–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142static AVFrameSideData *add_side_data_from_buf_ext(AVFrameSideData ***sd,
143 int *nb_sd,
144 enum AVFrameSideDataType type,
145 AVBufferRef *buf, uint8_t *data,
146 size_t size)
147{
148 AVFrameSideData *ret, **tmp;
149
150 // *nb_sd + 1 needs to fit into an int and a size_t.
151 if ((unsigned)*nb_sd >= FFMIN(INT_MAX, SIZE_MAX))
152 return NULL;
153
154 tmp = av_realloc_array(*sd, *nb_sd + 1, sizeof(**sd));
155 if (!tmp)
156 return NULL;
157 *sd = tmp;
158
159 ret = av_mallocz(sizeof(*ret));
160 if (!ret)
161 return NULL;
162
163 ret->buf = buf;
164 ret->data = data;
165 ret->size = size;
166 ret->type = type;
167
168 (*sd)[(*nb_sd)++] = ret;
169
170 return ret;
171}
172
173AVFrameSideData *ff_frame_side_data_add_from_buf(AVFrameSideData ***sd,
174 int *nb_sd,

Callers 2

av_frame_side_data_cloneFunction · 0.85

Calls 2

av_realloc_arrayFunction · 0.85
av_malloczFunction · 0.70

Tested by

no test coverage detected