[FFmpeg-devel] [PATCH 2/2] mpegaudio: call ff_mpegaudiodec_init_mmx() only from float decoder

Mans Rullgard mans
Thu Jul 1 18:26:38 CEST 2010


The mmx code is floating-point only, and this function does not know
from which decoder it is called.  Without this change, the integer
decoder only "works" because the size of the context struct is smaller
in this case, and the mmx init function writes the function pointer
outside the allocated context.
---
 libavcodec/mpegaudiodec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index 3edfc65..af5b3b8 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -320,7 +320,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
 
     s->avctx = avctx;
     s->apply_window_mp3 = apply_window_mp3_c;
-#if HAVE_MMX
+#if HAVE_MMX && CONFIG_FLOAT
     ff_mpegaudiodec_init_mmx(s);
 #endif
     avctx->sample_fmt= OUT_FMT;
-- 
1.7.1.1




More information about the ffmpeg-devel mailing list