[MPlayer-cvslog] r33196 - trunk/libaf/af_lavcac3enc.c

iive subversion at mplayerhq.hu
Sun Apr 3 16:39:27 CEST 2011


Author: iive
Date: Sun Apr  3 16:39:27 2011
New Revision: 33196

Log:
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.

Modified:
   trunk/libaf/af_lavcac3enc.c

Modified: trunk/libaf/af_lavcac3enc.c
==============================================================================
--- trunk/libaf/af_lavcac3enc.c	Sun Apr  3 16:26:38 2011	(r33195)
+++ trunk/libaf/af_lavcac3enc.c	Sun Apr  3 16:39:27 2011	(r33196)
@@ -95,6 +95,7 @@ static int control(struct af_instance_s 
             // 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) {


More information about the MPlayer-cvslog mailing list