[FFmpeg-cvslog] af_aresample: check ff_get_audio_buffer() failure

Michael Niedermayer git at videolan.org
Sat Nov 24 18:09:00 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Nov 24 17:33:32 2012 +0100| [014058abeaa9da2c107a6348178431ea8c9b0bab] | committer: Michael Niedermayer

af_aresample: check ff_get_audio_buffer() failure

Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavfilter/af_aresample.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
index 7201d37..5e43281 100644
--- a/libavfilter/af_aresample.c
+++ b/libavfilter/af_aresample.c
@@ -179,6 +179,9 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref)
     AVFilterBufferRef *outsamplesref = ff_get_audio_buffer(outlink, AV_PERM_WRITE, n_out);
     int ret;
 
+    if(!outsamplesref)
+        return AVERROR(ENOMEM);
+
     avfilter_copy_buffer_ref_props(outsamplesref, insamplesref);
     outsamplesref->format                = outlink->format;
     outsamplesref->audio->channel_layout = outlink->channel_layout;



More information about the ffmpeg-cvslog mailing list