Browse Source

avfilter: check a malloc in avfilter_link().

Additionally change sizeof(type) into sizeof(var)
tags/n2.0
Anton Khirnov 13 years ago
parent
commit
7e2b15c094
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      libavfilter/avfilter.c

+ 5
- 2
libavfilter/avfilter.c 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;


Loading…
Cancel
Save