[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
Sat Oct 22 15:19:02 EEST 2016


On Fri, Oct 21, 2016 at 03:42:09PM +0200, Michael Niedermayer wrote:
> On Fri, Oct 21, 2016 at 03:31:43PM +0200, Michael Niedermayer wrote:
> > 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();
> 
> this was not intended to be here ...

applied without this hunk

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161022/962d4b93/attachment.sig>


More information about the ffmpeg-devel mailing list