[FFmpeg-devel] [PATCH] lavfi/anullsrc: add missing checks
Stefano Sabatini
stefasab at gmail.com
Fri Mar 22 01:47:25 CET 2013
---
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;
--
1.7.9.5
More information about the ffmpeg-devel
mailing list