* 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
Showing the changes to libavfilter (1 of 8 files). Show all
Unified · Split
| @@ -239,10 +239,11 @@ static int link_filter_inouts(AVFilterContext *filt_ctx, · 238 unmodified lines | ||
| 239 | 239 | return AVERROR(ENOMEM); |
| 240 | 240 | |
| 241 | 241 | 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); | |
| 244 | 243 | av_free(p->name); |
| 245 | 244 | av_free(p); |
| 245 | + if (ret < 0) | |
| 246 | + return ret; | |
| 246 | 247 | } else { |
| 247 | 248 | p->filter_ctx = filt_ctx; |
| 248 | 249 | p->pad_idx = pad; |
| @@ -290,8 +291,10 @@ static int parse_inputs(const char **buf, AVFilterInOut **curr_inputs, · 41 unmodified lines | ||
| 290 | 291 | av_free(name); |
| 291 | 292 | } else { |
| 292 | 293 | /* 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); | |
| 294 | 296 | return AVERROR(ENOMEM); |
| 297 | + } | |
| 295 | 298 | match->name = name; |
| 296 | 299 | match->pad_idx = pad; |
| 297 | 300 | } |
| @@ -319,24 +322,27 @@ static int parse_outputs(const char **buf, AVFilterInOut **curr_inputs, · 21 unmodified lines | ||
| 319 | 322 | AVFilterInOut *match; |
| 320 | 323 | |
| 321 | 324 | AVFilterInOut *input = *curr_inputs; |
| 325 | + | |
| 326 | + if (!name) | |
| 327 | + return AVERROR(EINVAL); | |
| 328 | + | |
| 322 | 329 | if (!input) { |
| 323 | 330 | 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); | |
| 326 | 333 | return AVERROR(EINVAL); |
| 327 | 334 | } |
| 328 | 335 | *curr_inputs = (*curr_inputs)->next; |
| 329 | 336 | |
| 330 | − if (!name) | |
| 331 | − return AVERROR(EINVAL); | |
| 332 | − | |
| 333 | 337 | /* First check if the label is not in the open_inputs list */ |
| 334 | 338 | match = extract_inout(name, open_inputs); |
| 335 | 339 | |
| 336 | 340 | if (match) { |
| 337 | 341 | 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); | |
| 339 | 344 | return ret; |
| 345 | + } | |
| 340 | 346 | av_free(match->name); |
| 341 | 347 | av_free(name); |
| 342 | 348 | av_free(match); |