diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-04-01 15:44:21 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-05-17 20:32:27 +0200 |
commit | 7e2b15c094bb41ede9ce2a208982a20e4dfa26a6 (patch) | |
tree | 8bb4723a623ed0a7f876691753cd1ea22bbe2744 | |
parent | bf5b5d2b1561535cc013c12ab8033228bb0d0081 (diff) | |
download | ffmpeg-7e2b15c094bb41ede9ce2a208982a20e4dfa26a6.tar.gz |
avfilter: check a malloc in avfilter_link().
Additionally change sizeof(type) into sizeof(var)
-rw-r--r-- | libavfilter/avfilter.c | 7 |
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; |