]> git.sesse.net Git - ffmpeg/commitdiff
mpegaudio: call ff_mpegaudiodec_init_mmx() only from float decoder
authorMåns Rullgård <mans@mansr.com>
Thu, 1 Jul 2010 23:21:17 +0000 (23:21 +0000)
committerMåns Rullgård <mans@mansr.com>
Thu, 1 Jul 2010 23:21:17 +0000 (23:21 +0000)
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.

Fixes issue 2054.

Originally committed as revision 23949 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/mpegaudiodec.c

index 00ed7fc3f58dd6954264d442df932ae290485aa5..e5a1acecb03d87e7a290a66cef5dcb71be684065 100644 (file)
@@ -322,7 +322,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
     if (HAVE_ALTIVEC && CONFIG_FLOAT) ff_mpegaudiodec_init_altivec(s);