1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

af_aresample: check ff_get_audio_buffer() failure

Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-11-24 17:33:32 +01:00
parent ed017ab945
commit 014058abea

View 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;