avcodec/mpegaudiodec_template: only allocate fdsp when its used
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 5 Dec 2014 03:27:49 +0000 (04:27 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 5 Dec 2014 03:27:49 +0000 (04:27 +0100)
Fixes memleak

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mpegaudiodec_template.c

index bbd07c5..138a107 100644 (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);