Range check in TWin32WidgetSet.DrawText
Original Reporter info from Mantis: Petr-K
-
Reporter name:
Original Reporter info from Mantis: Petr-K
- Reporter name:
Description:
There is problem in the commit 46561 by jesus. Related to #23313 (closed)
If DrawText argument Str is not only ascii text and font is italic, then I get Range check error on line:
res := GetCharABCWidthsW(DC, Uint(W[Count-1]), Uint(W[Count-1]), paABC)
Problem is in W[Count-1].
In this case Count > Length(W), because argument Count is number of chars.
Included patch solves it.
---
Another remark:
I think that argument for GetCharABCWidthsW should be W[Count] (last character) instead of W[Count-1] (before last character)
Mantis conversion info:
- Mantis ID: 27028
- OS: WinXP
- Build: trunk #46763
- Platform: Win32
- Version: 1.3 (SVN)
- Fixed in version: 1.4
- Fixed in revision: 46835 (#24b2ab0f)
- Target version: 1.4