History

Merge commit '1b891d17c531e8a63c2974aab4bf997ce70746f3'

* commit '1b891d17c531e8a63c2974aab4bf997ce70746f3': avconv: fix bitrate report when writing to /dev/null avfilter: fix graphparser memleaks on error paths rawdec: remove ff_raw_read_header pcmdec: remove dependency from rawdec g722: refactor out of rawdec.c rawvideo: use a specific read_header Conflicts: ffmpeg.c libavformat/Makefile libavformat/rawdec.c

Michael Niedermayer committed 14 years ago

Commit 507f2942 parents 9f36ec6 1b891d18 files · +199 −141Browse files

Showing the changes to libavfilter/graphparser.c (1 of 8 files). Show all

Unified · Split

libavfilter/graphparser.c+15−9
@@ -239,10 +239,11 @@ static int link_filter_inouts(AVFilterContext *filt_ctx, · 238 unmodified lines
239239 return AVERROR(ENOMEM);
240240
241241 if (p->filter_ctx) {
242− if ((ret = link_filter(p->filter_ctx, p->pad_idx, filt_ctx, pad, log_ctx)) < 0)
243− return ret;
242+ ret = link_filter(p->filter_ctx, p->pad_idx, filt_ctx, pad, log_ctx);
244243 av_free(p->name);
245244 av_free(p);
245+ if (ret < 0)
246+ return ret;
246247 } else {
247248 p->filter_ctx = filt_ctx;
248249 p->pad_idx = pad;
@@ -290,8 +291,10 @@ static int parse_inputs(const char **buf, AVFilterInOut **curr_inputs, · 41 unmodified lines
290291 av_free(name);
291292 } else {
292293 /* Not in the list, so add it as an input */
293− if (!(match = av_mallocz(sizeof(AVFilterInOut))))
294+ if (!(match = av_mallocz(sizeof(AVFilterInOut)))) {
295+ av_free(name);
294296 return AVERROR(ENOMEM);
297+ }
295298 match->name = name;
296299 match->pad_idx = pad;
297300 }
@@ -319,24 +322,27 @@ static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs, · 21 unmodified lines
319322 AVFilterInOut *match;
320323
321324 AVFilterInOut *input = *curr_inputs;
325+
326+ if (!name)
327+ return AVERROR(EINVAL);
328+
322329 if (!input) {
323330 av_log(log_ctx, AV_LOG_ERROR,
324− "No output pad can be associated to link label '%s'.\n",
325− name);
331+ "No output pad can be associated to link label '%s'.\n", name);
332+ av_free(name);
326333 return AVERROR(EINVAL);
327334 }
328335 *curr_inputs = (*curr_inputs)->next;
329336
330− if (!name)
331− return AVERROR(EINVAL);
332−
333337 /* First check if the label is not in the open_inputs list */
334338 match = extract_inout(name, open_inputs);
335339
336340 if (match) {
337341 if ((ret = link_filter(input->filter_ctx, input->pad_idx,
338− match->filter_ctx, match->pad_idx, log_ctx)) < 0)
342+ match->filter_ctx, match->pad_idx, log_ctx)) < 0) {
343+ av_free(name);
339344 return ret;
345+ }
340346 av_free(match->name);
341347 av_free(name);
342348 av_free(match);

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