[FFmpeg-devel] [PATCH] aacenc: Fix a segfault in search_for_quantizers

Måns Rullgård mans
Tue Mar 8 12:24:51 CET 2011


Nathan Caldwell <saintdev at gmail.com> writes:

> This reverts the removal of scoefs from AACEncContext.
> It resulted in scoefs being a NULL pointer when
> search_for_quantizers() is called.
> ---
>  libavcodec/aacenc.c |    1 -
>  libavcodec/aacenc.h |    2 +-
>  2 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
> index 17ae6f9..0ca390e 100644
> --- a/libavcodec/aacenc.c
> +++ b/libavcodec/aacenc.c
> @@ -598,7 +598,6 @@ static int aac_encode_frame(AVCodecContext *avctx,
>              }
>              for (j = 0; j < chans; j++) {
>                  s->cur_channel = start_ch + j;
> -                s->scoefs = cpe->ch[j].ret;
>                  encode_individual_channel(avctx, s, &cpe->ch[j],
> cpe->common_window);
>              }
>              start_ch += chans;
> diff --git a/libavcodec/aacenc.h b/libavcodec/aacenc.h
> index 3559234..1c84679 100644
> --- a/libavcodec/aacenc.h
> +++ b/libavcodec/aacenc.h
> @@ -63,8 +63,8 @@ typedef struct AACEncContext {
>      int cur_channel;
>      int last_frame;
>      float lambda;
> -    float *scoefs;                               ///< scaled coefficients
>      DECLARE_ALIGNED(16, int,   qcoefs)[96];      ///< quantized coefficients
> +    DECLARE_ALIGNED(16, float, scoefs)[1024];    ///< scaled coefficients
>  } AACEncContext;
>
>  #endif /* AVCODEC_AACENC_H */
> -- 
> 1.7.4.1

Is it impossible to align the thing it points to now?  Saving 4k data
can make a real difference.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list