Commit 9f8f2bca authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'c3bd1d60'

* commit 'c3bd1d60':
  formats: Check memory allocations

Conflicts:
	libavfilter/formats.c

See: 527ca398Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 8b3a681a c3bd1d60
...@@ -281,12 +281,13 @@ int ff_fmt_is_in(int fmt, const int *fmts) ...@@ -281,12 +281,13 @@ int ff_fmt_is_in(int fmt, const int *fmts)
for (count = 0; fmts[count] != -1; count++) \ for (count = 0; fmts[count] != -1; count++) \
; \ ; \
formats = av_mallocz(sizeof(*formats)); \ formats = av_mallocz(sizeof(*formats)); \
if (!formats) return NULL; \ if (!formats) \
return NULL; \
formats->count_field = count; \ formats->count_field = count; \
if (count) { \ if (count) { \
formats->field = av_malloc_array(count, sizeof(*formats->field)); \ formats->field = av_malloc_array(count, sizeof(*formats->field)); \
if (!formats->field) { \ if (!formats->field) { \
av_free(formats); \ av_freep(&formats); \
return NULL; \ return NULL; \
} \ } \
} }
...@@ -415,6 +416,8 @@ AVFilterChannelLayouts *ff_all_channel_counts(void) ...@@ -415,6 +416,8 @@ AVFilterChannelLayouts *ff_all_channel_counts(void)
do { \ do { \
*ref = f; \ *ref = f; \
f->refs = av_realloc(f->refs, sizeof(*f->refs) * ++f->refcount); \ f->refs = av_realloc(f->refs, sizeof(*f->refs) * ++f->refcount); \
if (!f->refs) \
return; \
f->refs[f->refcount-1] = ref; \ f->refs[f->refcount-1] = ref; \
} while (0) } while (0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment