From b9ffafbfcc0f8aaffc9de3919a1d295dbe6d53f7 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 21 Nov 2014 22:15:32 +0100 Subject: 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 --- libavfilter/formats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavfilter/formats.c') diff --git a/libavfilter/formats.c b/libavfilter/formats.c index 42afcf4ab4..eb3b87a56c 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -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++) { \ -- cgit v1.2.3