On July 14, 2008 03:17:19 pm Benjamin Larsson wrote:
> Pascal Patry wrote:
> > I'm getting a segfault while using the latest AAC decoder with the latest
> > FFmpeg revision on multiple files.
> >
> > The problem seems to be coming from this line (aac.c:2239):
> > ac->dsp.float_to_int16(data, ac->interleaved_output, 1024 *
> > avccontext->channels);
> >
> > Here is the complete stack while using ffplay:
> > #0  0x08102535 in float_to_int16_sse2 (dst=0xb71c90c0, src=0x8801f48,
> > len=2048) at libavcodec/i386/dsputil_mmx.c:2141
>
> interleaved_output doesn't seem to have the required alignment.

Thank you for pointing out.

Here is a patch to fix the issue.
Index: aac.c
===================================================================
--- aac.c	(revision 2781)
+++ aac.c	(working copy)
@@ -434,7 +434,7 @@
      * @defgroup output   Members used for output interleaving and down-mixing.
      * @{
      */
-    float* interleaved_output;                        ///< Interim buffer for interleaving PCM samples.
+    DECLARE_ALIGNED_16(float, interleaved_output[MAX_CHANNELS * 1024]); ///< Interim buffer for interleaving PCM samples.
     float *output_data[MAX_CHANNELS];                 ///< Points to each element's 'ret' buffer (PCM output).
     ChannelElement *mm[3];                            ///< Center/Front/Back channel elements to use for matrix mix-down.
     float add_bias;                                   ///< offset for dsp.float_to_int16
@@ -604,11 +604,7 @@
     }
 
     avctx->channels = channels;
-    ilo_tmp = ac->interleaved_output;
-    ac->interleaved_output = av_realloc(ac->interleaved_output, channels * 1024 * sizeof(float));
-    if(!ac->interleaved_output)
-        av_freep(ilo_tmp);
-    return ac->interleaved_output ? 0 : -1;
+    return 0;
 }
 
 
@@ -2335,7 +2331,6 @@
         av_free(ac->mdct_ltp);
     }
 #endif /* AAC_LTP */
-    av_free(ac->interleaved_output);
     return 0 ;
 }
 
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to