riched20: Prevent setting an invalid default format rect

Thomas Faber thfabba at gmx.de
Sat Oct 15 05:10:57 CDT 2011


Many applications (e.g. mIRC 7.19) create richedit controls with zero or
almost-zero width/height. The ME_SetDefaultFormatRect function does not
take this into account when calculating the format rect, and will create
and invalid rectangle (left > right or similar) in this case, which is
then be passed on to several other functions, and results in negative
values for "available width" fields considered when doing wrapping
calculations.
This will for instance lead to an assertion failure when Wine's
riched20.dll is used on Windows [1].

The patch fixes this by adding checks to ME_SetDefaultFormatRect to
use the minimal rectangle that is still valid in this case.


[1] http://img546.imageshack.us/img546/9822/riched.png

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-riched20-Prevent-setting-an-invalid-default-format-r.patch
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20111015/073ed230/attachment.ksh>


More information about the wine-patches mailing list