avfilter/formats: Alloc NULL fmts in SET_COMMON_FORMATS()

This avoids null pointer dereferences in case memory allocation has failed

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-11-21 22:15:32 +01:00
parent 75819fafd8
commit b9ffafbfcc

View File

@ -494,7 +494,7 @@ void ff_formats_changeref(AVFilterFormats **oldref, AVFilterFormats **newref)
}
#define SET_COMMON_FORMATS(ctx, fmts, in_fmts, out_fmts, ref, list) \
{ \
if (fmts) { \
int count = 0, i; \
\
for (i = 0; i < ctx->nb_inputs; i++) { \