Browse Source

avfilter/copy: add forgotten check

tags/n4.3
Paul B Mahol 5 years ago
parent
commit
94b155e49b
2 changed files with 6 additions and 2 deletions
  1. +3
    -1
      libavfilter/af_acopy.c
  2. +3
    -1
      libavfilter/vf_copy.c

+ 3
- 1
libavfilter/af_acopy.c View File

@@ -26,8 +26,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVFrame *out = ff_get_audio_buffer(outlink, in->nb_samples); AVFrame *out = ff_get_audio_buffer(outlink, in->nb_samples);
int ret; int ret;


if (!out)
if (!out) {
ret = AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
goto fail;
}


ret = av_frame_copy_props(out, in); ret = av_frame_copy_props(out, in);
if (ret < 0) if (ret < 0)


+ 3
- 1
libavfilter/vf_copy.c View File

@@ -50,8 +50,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVFrame *out = ff_get_video_buffer(outlink, in->width, in->height); AVFrame *out = ff_get_video_buffer(outlink, in->width, in->height);
int ret; int ret;


if (!out)
if (!out) {
ret = AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
goto fail;
}


ret = av_frame_copy_props(out, in); ret = av_frame_copy_props(out, in);
if (ret < 0) if (ret < 0)


Loading…
Cancel
Save