History

avfilter/af_acopy: check for error cases and handle them

Paul B Mahol committed 7 years ago

Commit c9473221 parent 835fdf41 file · +14 −6Browse files

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

Unified · Split

libavfilter/af_acopy.c+14−6
@@ -24,15 +24,23 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 23 unmodified lines
2424 {
2525 AVFilterLink *outlink = inlink->dst->outputs[0];
2626 AVFrame *out = ff_get_audio_buffer(outlink, in->nb_samples);
27+ int ret;
2728
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;
3438 av_frame_free(&in);
3539 return ff_filter_frame(outlink, out);
40+fail:
41+ av_frame_free(&in);
42+ av_frame_free(&out);
43+ return ret;
3644 }
3745
3846 static const AVFilterPad acopy_inputs[] = {

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