summaryrefslogtreecommitdiff
path: root/libavfilter/avfilter.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-04-01 15:44:21 +0200
committerAnton Khirnov <anton@khirnov.net>2013-05-17 20:32:27 +0200
commit7e2b15c094bb41ede9ce2a208982a20e4dfa26a6 (patch)
tree8bb4723a623ed0a7f876691753cd1ea22bbe2744 /libavfilter/avfilter.c
parentbf5b5d2b1561535cc013c12ab8033228bb0d0081 (diff)
avfilter: check a malloc in avfilter_link().
Additionally change sizeof(type) into sizeof(var)
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r--libavfilter/avfilter.c7
1 files changed, 5 insertions, 2 deletions
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;