mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avfilter/af_acopy: check for error cases and handle them
This commit is contained in:
parent
835fdf48e5
commit
c9473229c9
@ -24,15 +24,23 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
{
|
||||
AVFilterLink *outlink = inlink->dst->outputs[0];
|
||||
AVFrame *out = ff_get_audio_buffer(outlink, in->nb_samples);
|
||||
int ret;
|
||||
|
||||
if (!out) {
|
||||
av_frame_free(&in);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
av_frame_copy_props(out, in);
|
||||
av_frame_copy(out, in);
|
||||
if (!out)
|
||||
ret = AVERROR(ENOMEM);
|
||||
|
||||
ret = av_frame_copy_props(out, in);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
ret = av_frame_copy(out, in);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
av_frame_free(&in);
|
||||
return ff_filter_frame(outlink, out);
|
||||
fail:
|
||||
av_frame_free(&in);
|
||||
av_frame_free(&out);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const AVFilterPad acopy_inputs[] = {
|
||||
|
Loading…
Reference in New Issue
Block a user