# HG changeset patch # User iive # Date 1301841567 0 # Node ID 01b19cf2649c4dabcb075103f96beff4ee88e47e # Parent 5450a92ac4bd632df8eba0f430b7b19b45db859b Fix segfault in lavcac3enc audio filter. The FFmpeg ac3 encoder would fail to open if the correct sample format is not set. As the opening is done in control() the audio filter would not fail back, but would instead continue and call encoding functions that dereference NULL pointer. diff -r 5450a92ac4bd -r 01b19cf2649c libaf/af_lavcac3enc.c --- a/libaf/af_lavcac3enc.c Sun Apr 03 14:26:38 2011 +0000 +++ b/libaf/af_lavcac3enc.c Sun Apr 03 14:39:27 2011 +0000 @@ -95,6 +95,7 @@ // Put sample parameters s->lavc_actx->channels = af->data->nch; s->lavc_actx->sample_rate = af->data->rate; + s->lavc_actx->sample_fmt = AV_SAMPLE_FMT_S16; s->lavc_actx->bit_rate = bit_rate; if(avcodec_open(s->lavc_actx, s->lavc_acodec) < 0) {