Merge remote-tracking branch 'qatar/master'
* qatar/master: (28 commits) dfa: use more meaningful return codes eatgv: check vector_bits eatgv: check motion vectors Mark a number of variables only used in av_dlog() calls as av_unused. dvdec: drop const qualifier from variable to eliminate a warning avcodec: Improve comment for thread_safe_callbacks to avoid misinterpretation. tests/utils: don't ignore the return value of fwrite() lavfi/formats: use sizeof(var) instead of sizeof(type). lavfi: remove avfilter_default_config_input_link() declaration lavfi: always enable the scale filter and depend on sws. vf_split: support user-specifiable number of outputs. avconv: remove stray useless comment. mpegmux: add stuffing to avoid incomplete PCM frames rtsp: avoid const warnings from strtol() call avserver: check return value of ftruncate() lagarith: make offset array type unsigned dfa: add some checks to ensure that decoder won't write past frame end aacps: NEON optimisations aacps: align some arrays aacps: move some loops to function pointers ... Conflicts: configure doc/filters.texi libavcodec/dfa.c libavcodec/eatgv.c libavfilter/Makefile libavfilter/allfilters.c libavfilter/avfilter.h libavfilter/formats.c libavfilter/vf_split.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -49,7 +49,7 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
|
||||
|
||||
if (a == b) return a;
|
||||
|
||||
ret = av_mallocz(sizeof(AVFilterFormats));
|
||||
ret = av_mallocz(sizeof(*ret));
|
||||
|
||||
/* merge list of formats */
|
||||
ret->formats = av_malloc(sizeof(*ret->formats) * FFMIN(a->format_count,
|
||||
@@ -74,7 +74,7 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
|
||||
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);
|
||||
@@ -158,7 +158,7 @@ int avfilter_add_format(AVFilterFormats **avff, int64_t fmt)
|
||||
{
|
||||
int64_t *fmts;
|
||||
|
||||
if (!(*avff) && !(*avff = av_mallocz(sizeof(AVFilterFormats))))
|
||||
if (!(*avff) && !(*avff = av_mallocz(sizeof(**avff))))
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
fmts = av_realloc((*avff)->formats,
|
||||
@@ -217,7 +217,7 @@ AVFilterFormats *avfilter_make_all_packing_formats(void)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -239,9 +239,9 @@ void avfilter_formats_unref(AVFilterFormats **ref)
|
||||
|
||||
idx = find_ref_index(ref);
|
||||
|
||||
if (idx >= 0)
|
||||
memmove((*ref)->refs + idx, (*ref)->refs + idx+1,
|
||||
sizeof(AVFilterFormats**) * ((*ref)->refcount-idx-1));
|
||||
if(idx >= 0)
|
||||
memmove((*ref)->refs + idx, (*ref)->refs + idx + 1,
|
||||
sizeof(*(*ref)->refs) * ((*ref)->refcount - idx - 1));
|
||||
|
||||
if (!--(*ref)->refcount) {
|
||||
av_free((*ref)->formats);
|
||||
|
||||
Reference in New Issue
Block a user