[FFmpeg-devel] [PATCH 4/7] avcodec/mpegvideo_enc: Add missing emms_c() to clear MMX state after SIMD use
Michael Niedermayer
michael at niedermayer.cc
Fri Oct 21 16:31:43 EEST 2016
Fixes undefined behavior due to calling libc allocation with unclean FPU state
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavcodec/mpegvideo_enc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index f34003e..b2c5eab 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);
@@ -1890,6 +1891,7 @@ int ff_mpv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
return ret;
vbv_retry:
ret = encode_picture(s, s->picture_number);
+// emms_c();
if (growing_buffer) {
av_assert0(s->pb.buf == avctx->internal->byte_buffer);
pkt->data = s->pb.buf;
--
2.10.1
More information about the ffmpeg-devel
mailing list