[FFmpeg-devel] [PATCH] swscale: avoid overread in planar2x

Måns Rullgård mans
Sun Sep 12 11:25:35 CEST 2010

Ramiro Polla <ramiro.polla at gmail.com> writes:

> Hi,
> The MMX2/3dnow code in planar2x in rgb2rgb currently reads one byte
> prior to the source buffer. This leads to a crash on Windows and Mac
> OS X when the buffer is allocated on the beginning of a page. This
> should also be a problem on Linux but I haven't seen many crashes
> because of overreading...
> It does involve a 0.8% slowdown though. If this slowdown is not
> acceptable, I wonder if we can add a configure option that will enable
> the user to avoid overreads at the cost of suffering a little slowdown
> (like --enable-avoid-overreads). There are other places that assume a
> small overread is not a problem, but end up crashing on Windows and
> Mac OS X.

The correct solution is usually to allocate a little extra.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list