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

Måns Rullgård mans
Sun Sep 12 12:58:02 CEST 2010

Michael Niedermayer <michaelni at gmx.at> writes:

> On Sun, Sep 12, 2010 at 10:25:35AM +0100, M?ns Rullg?rd wrote:
>> 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.
> not if the value of the read outside byte affect the output and thus
> regression testability

I assumed, apparently in error, that the code was correct.  If that is
not the case, it should of course be fixed.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list