Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -24,15 +24,23 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 23 unmodified lines | ||
| 24 | 24 | { |
| 25 | 25 | AVFilterLink *outlink = inlink->dst->outputs[0]; |
| 26 | 26 | AVFrame *out = ff_get_audio_buffer(outlink, in->nb_samples); |
| 27 | + int ret; | |
| 27 | 28 | |
| 28 | − if (!out) { | |
| 29 | − av_frame_free(&in); | |
| 30 | − return AVERROR(ENOMEM); | |
| 31 | − } | |
| 32 | − av_frame_copy_props(out, in); | |
| 33 | − av_frame_copy(out, in); | |
| 29 | + if (!out) | |
| 30 | + ret = AVERROR(ENOMEM); | |
| 31 | + | |
| 32 | + ret = av_frame_copy_props(out, in); | |
| 33 | + if (ret < 0) | |
| 34 | + goto fail; | |
| 35 | + ret = av_frame_copy(out, in); | |
| 36 | + if (ret < 0) | |
| 37 | + goto fail; | |
| 34 | 38 | av_frame_free(&in); |
| 35 | 39 | return ff_filter_frame(outlink, out); |
| 40 | +fail: | |
| 41 | + av_frame_free(&in); | |
| 42 | + av_frame_free(&out); | |
| 43 | + return ret; | |
| 36 | 44 | } |
| 37 | 45 | |
| 38 | 46 | static const AVFilterPad acopy_inputs[] = { |