X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Faf_volume.c;h=8b5d4c404a87cb5d27b2f6db11676137b6447d03;hb=9e329185d701f60412eb70c4ffbeb345bd459e82;hp=269a2a527af5760aa5ac037732bfb89e1d36848e;hpb=de7b50e9cde715b8ccfef2c83def08b4e8581432;p=ffmpeg diff --git a/libavfilter/af_volume.c b/libavfilter/af_volume.c index 269a2a527af..8b5d4c404a8 100644 --- a/libavfilter/af_volume.c +++ b/libavfilter/af_volume.c @@ -325,6 +325,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) int nb_samples = buf->nb_samples; AVFrame *out_buf; int64_t pos; + int ret; if (isnan(vol->var_values[VAR_STARTPTS])) { vol->var_values[VAR_STARTPTS] = TS2D(buf->pts); @@ -351,7 +352,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) out_buf = ff_get_audio_buffer(inlink, nb_samples); if (!out_buf) return AVERROR(ENOMEM); - av_frame_copy_props(out_buf, buf); + ret = av_frame_copy_props(out_buf, buf); + if (ret < 0) { + av_frame_free(&out_buf); + av_frame_free(&buf); + return ret; + } } if (vol->precision != PRECISION_FIXED || vol->volume_i > 0) {