[FFmpeg-cvslog] avcodec/mpegaudiodec_template: only allocate fdsp when its used

Michael Niedermayer git at videolan.org
Fri Dec 5 05:16:03 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Dec  5 04:27:49 2014 +0100| [a7ebd0b011f9576c843a86bd6a1828ecaa6faf3a] | committer: Michael Niedermayer

avcodec/mpegaudiodec_template: only allocate fdsp when its used

Fixes memleak

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a7ebd0b011f9576c843a86bd6a1828ecaa6faf3a
---

 libavcodec/mpegaudiodec_template.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c
index bbd07c5..138a107 100644
--- a/libavcodec/mpegaudiodec_template.c
+++ b/libavcodec/mpegaudiodec_template.c
@@ -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);
 



More information about the ffmpeg-cvslog mailing list