[FFmpeg-cvslog] lavfi/anullsrc: add missing checks

Stefano Sabatini git at videolan.org
Sat Mar 23 16:59:38 CET 2013


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Fri Mar 22 01:43:43 2013 +0100| [a42d15a3a0efddf693218bc1c94f98f8c48a7469] | committer: Stefano Sabatini

lavfi/anullsrc: add missing checks

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a42d15a3a0efddf693218bc1c94f98f8c48a7469
---

 libavfilter/asrc_anullsrc.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavfilter/asrc_anullsrc.c b/libavfilter/asrc_anullsrc.c
index 062aefc..84260c3 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;



More information about the ffmpeg-cvslog mailing list