diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2013-03-22 01:43:43 +0100 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2013-03-23 16:53:25 +0100 |
commit | a42d15a3a0efddf693218bc1c94f98f8c48a7469 (patch) | |
tree | 1aee17881fd845e136293fac03de78a96c4ca6e5 | |
parent | 4e8062c2d77f351127db6cc09167fa79d7b0d085 (diff) | |
download | ffmpeg-a42d15a3a0efddf693218bc1c94f98f8c48a7469.tar.gz |
lavfi/anullsrc: add missing checks
-rw-r--r-- | libavfilter/asrc_anullsrc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavfilter/asrc_anullsrc.c b/libavfilter/asrc_anullsrc.c index 062aefcb2d..84260c3721 100644 --- a/libavfilter/asrc_anullsrc.c +++ b/libavfilter/asrc_anullsrc.c @@ -114,12 +114,17 @@ static int request_frame(AVFilterLink *outlink) AVFrame *samplesref; samplesref = ff_get_audio_buffer(outlink, null->nb_samples); + if (!samplesref) + return AVERROR(ENOMEM); + samplesref->pts = null->pts; samplesref->channel_layout = null->channel_layout; samplesref->sample_rate = outlink->sample_rate; ret = ff_filter_frame(outlink, av_frame_clone(samplesref)); av_frame_free(&samplesref); + if (ret < 0) + return ret; null->pts += null->nb_samples; return ret; |