avcodec/mpegaudiodec_template: only allocate fdsp when its used

Fixes memleak

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-12-05 04:27:49 +01:00
parent 4a0b1d9245
commit a7ebd0b011
1 changed files with 2 additions and 0 deletions

View File

@ -428,9 +428,11 @@ static av_cold int decode_init(AVCodecContext * avctx)
s->avctx = avctx;
#if USE_FLOATS
s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
if (!s->fdsp)
return AVERROR(ENOMEM);
#endif
ff_mpadsp_init(&s->mpadsp);