avfilter: check a malloc in avfilter_link().

Additionally change sizeof(type) into sizeof(var)
This commit is contained in:
Anton Khirnov 2013-04-01 15:44:21 +02:00
parent bf5b5d2b15
commit 7e2b15c094

View File

@ -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;