[FFmpeg-cvslog] avcodec/mpegvideo_enc: Add missing emms_c() to clear MMX state after SIMD use

Michael Niedermayer git at videolan.org
Sat Oct 22 15:28:10 EEST 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Oct 21 15:01:36 2016 +0200| [de0cd0ffc9e4b7780d0cae5f969aca4e3bdf7e48] | committer: Michael Niedermayer

avcodec/mpegvideo_enc: Add missing emms_c() to clear MMX state after SIMD use

Fixes undefined behavior due to calling libc allocation with unclean FPU state

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/mpegvideo_enc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index f34003e..1540e5c 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1320,6 +1320,7 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
                                                 EDGE_BOTTOM);
                     }
                 }
+                emms_c();
             }
         }
         ret = av_frame_copy_props(pic->f, pic_arg);



More information about the ffmpeg-cvslog mailing list