History

avfilter: check a malloc in avfilter_link().

Additionally change sizeof(type) into sizeof(var)

Anton Khirnov committed 13 years ago

Commit 7e2b15c1 parent bf5b5d21 file · +5 −2Browse files

Showing the changes to libavfilter/avfilter.c (1 of 1 file). Show all

Unified · Split

libavfilter/avfilter.c+5−2
@@ -87,8 +87,11 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad, · 86 unmodified lines
8787 return AVERROR(EINVAL);
8888 }
8989
90− src->outputs[srcpad] =
91− dst-> inputs[dstpad] = link = av_mallocz(sizeof(AVFilterLink));
90+ link = av_mallocz(sizeof(*link));
91+ if (!link)
92+ return AVERROR(ENOMEM);
93+
94+ src->outputs[srcpad] = dst->inputs[dstpad] = link;
9295
9396 link->src = src;
9497 link->dst = dst;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t