[Regression] Range check error when painting a 1-character string in italic
Original Reporter info from Mantis: wp @wpam
-
Reporter name:
Original Reporter info from Mantis: wp @wpam
- Reporter name:
Description:
Revision 46561 improved painting of italic text. However, this introduced a range check error when the painted string is only 1 character long.
The crash occurs in line 1184 of win32winapi.inc where
res := GetCharABCWidthsW(DC, Uint(W[Count-1]), Uint(W[Count-1]), paABC)
My interpretation: If the string W is only 1 character long (Count=1), then W[Count-1] addresses the non-existing zero'th character of the string.
Steps to reproduce:
Compile the attached demo. Click on the button which formats the label "a" in italic. But this does not happen because of the run-time error.
Additional information:
Note: My IDE is compiled with the profile "DebugIDE". The bug does not occur with "NormalIDE".
Mantis conversion info:
- Mantis ID: 27033
- OS: Windows 32bit
- OS Build: win7
- Platform: x64
- Version: 1.3 (SVN)