[FFmpeg-cvslog] avcodec/snowenc: Clear MMX state after edge drawing and picture encode

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


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Oct 21 15:10:48 2016 +0200| [2c1d38d1e1c2617f51bbb833bb7fe1298644cd21] | committer: Michael Niedermayer

avcodec/snowenc: Clear MMX state after edge drawing and picture encode

Fixes undefined behavior from 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=2c1d38d1e1c2617f51bbb833bb7fe1298644cd21
---

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

diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index 00aef57..5cc7997 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -1640,6 +1640,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
                                     s->current_picture->linesize[2], w>>s->chroma_h_shift, h>>s->chroma_v_shift,
                                     EDGE_WIDTH>>s->chroma_h_shift, EDGE_WIDTH>>s->chroma_v_shift, EDGE_TOP | EDGE_BOTTOM);
         }
+        emms_c();
     }
 
     ff_snow_frame_start(s);
@@ -1856,6 +1857,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
         }
 
     }
+    emms_c();
 
     update_last_header_values(s);
 



More information about the ffmpeg-cvslog mailing list