X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Faacdec.c;h=0174bf8d5bd1521400107047b03d21977ae81c00;hb=ef6a9e5e311f09fa8032974fa4d0c1e166a959bb;hp=d394700cdc857fa9386fc60ed2509fd869461f7f;hpb=4069096dd535ee99175c2a29c1a1f59c3fc110c1;p=ffmpeg diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index d394700cdc8..0174bf8d5bd 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -69,6 +69,11 @@ # include "mips/aacdec_mips.h" #endif +DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(sine_120))[120]; +DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(sine_960))[960]; +DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(aac_kbd_long_960))[960]; +DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(aac_kbd_short_120))[120]; + static av_always_inline void reset_predict_state(PredictorState *ps) { ps->r0 = 0.0f; @@ -247,14 +252,12 @@ static void apply_independent_coupling(AACContext *ac, SingleChannelElement *target, ChannelElement *cce, int index) { - int i; const float gain = cce->coup.gain[index][0]; const float *src = cce->ch[0].ret; float *dest = target->ret; const int len = 1024 << (ac->oc[1].m4ac.sbr == 1); - for (i = 0; i < len; i++) - dest[i] += gain * src[i]; + ac->fdsp->vector_fmac_scalar(dest, src, gain, len); } #include "aacdec_template.c" @@ -411,6 +414,8 @@ static int read_stream_mux_config(struct LATMContext *latmctx, } else { int esc; do { + if (get_bits_left(gb) < 9) + return AVERROR_INVALIDDATA; esc = get_bits(gb, 1); skip_bits(gb, 8); } while (esc); @@ -561,7 +566,7 @@ AVCodec ff_aac_decoder = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .channel_layouts = aac_channel_layout, .flush = flush, .priv_class = &aac_decoder_class, @@ -586,7 +591,7 @@ AVCodec ff_aac_latm_decoder = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .channel_layouts = aac_channel_layout, .flush = flush, .profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),