From: Anton Khirnov Date: Mon, 1 Apr 2013 13:44:21 +0000 (+0200) Subject: avfilter: check a malloc in avfilter_link(). X-Git-Tag: android-x86-4.4-r1~364^2~1004 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7e2b15c094bb41ede9ce2a208982a20e4dfa26a6;p=android-x86%2Fexternal-ffmpeg.git avfilter: check a malloc in avfilter_link(). Additionally change sizeof(type) into sizeof(var) --- diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 95fc700dc2..b7913a12cc 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -87,8 +87,11 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad, return AVERROR(EINVAL); } - src->outputs[srcpad] = - dst-> inputs[dstpad] = link = av_mallocz(sizeof(AVFilterLink)); + link = av_mallocz(sizeof(*link)); + if (!link) + return AVERROR(ENOMEM); + + src->outputs[srcpad] = dst->inputs[dstpad] = link; link->src = src; link->dst = dst;