AVFilterFormats *ret;
unsigned i, j, k = 0, m_count;
- ret = av_mallocz(sizeof(AVFilterFormats));
+ ret = av_mallocz(sizeof(*ret));
/* merge list of formats */
m_count = FFMIN(a->format_count, b->format_count);
return NULL;
}
- ret->refs = av_malloc(sizeof(AVFilterFormats**)*(a->refcount+b->refcount));
+ ret->refs = av_malloc(sizeof(*ret->refs) * (a->refcount + b->refcount));
merge_ref(ret, a);
merge_ref(ret, b);
for (count = 0; fmts[count] != -1; count++)
;
- formats = av_mallocz(sizeof(AVFilterFormats));
+ formats = av_mallocz(sizeof(*formats));
if (count)
formats->formats = av_malloc(sizeof(*formats->formats) * count);
formats->format_count = count;
{
int *fmts;
- if (!(*avff) && !(*avff = av_mallocz(sizeof(AVFilterFormats))))
+ if (!(*avff) && !(*avff = av_mallocz(sizeof(**avff))))
return AVERROR(ENOMEM);
fmts = av_realloc((*avff)->formats,
void avfilter_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
{
*ref = f;
- f->refs = av_realloc(f->refs, sizeof(AVFilterFormats**) * ++f->refcount);
+ f->refs = av_realloc(f->refs, sizeof(*f->refs) * ++f->refcount);
f->refs[f->refcount-1] = ref;
}
idx = find_ref_index(ref);
if(idx >= 0)
- memmove((*ref)->refs + idx, (*ref)->refs + idx+1,
- sizeof(AVFilterFormats**) * ((*ref)->refcount-idx-1));
+ memmove((*ref)->refs + idx, (*ref)->refs + idx + 1,
+ sizeof(*(*ref)->refs) * ((*ref)->refcount - idx - 1));
if(!--(*ref)->refcount) {
av_free((*ref)->formats);