af_aresample: check ff_get_audio_buffer() failure
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 24 Nov 2012 16:33:32 +0000 (17:33 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 24 Nov 2012 16:33:32 +0000 (17:33 +0100)
Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/af_aresample.c

index 7201d37..5e43281 100644 (file)
@@ -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;